user3315774
user3315774

Reputation: 21

Streaming webm video using lighttpd memory usage

I have a folder of webm videos on my website and I would like to stream them.

When you go to mysite.com/media/video.webm you get a firefox native webm video player and the video is streaming correctly. The server only has 512MB memory and while the video is streaming all free memory disappears. (from 300MB to only 16MB of free space) The video is just read from the file, but I think the entire video gets cached while it is viewed.

How do I stream a video via lighttpd without loosing all my memory?

Upvotes: 2

Views: 732

Answers (1)

gstrauss
gstrauss

Reputation: 2369

In lighttpd.conf, use server.network-backend = "sendfile"

If you have a CGI or FastCGI or SCGI backend that is serving the file to lighttpd, then modify those scripts to return X-Sendfile: /path/to/file.webm and configure mod_cgi, mod_fastcgi, or mod_scgi to accept X-Sendfile response header from backends.

In any case, lighttpd 1.4.40 and later put large responses from backends into temporary files, so the server memory usage should remain low, regardless of the size of the files being served.

Upvotes: 0

Related Questions