官术网_书友最值得收藏!

  • Lighttpd
  • Andre Bogus
  • 263字
  • 2021-08-25 18:06:23

Chapter 4. Downloads and Streams

A huge section of the Internet is reserved for downloadable and streamable content. Music, images, movies, programs, and things we have not thought about yet are made available (maybe for a small fee or through their advertisements) as a direct download. Music and movies (the latter often in flash video or short flv format) can also be streamed. Sites like YouTube, using Lighttpd to serve video files, show that Lighttpd has got what it takes to do this job.

Large files present a special scenario to our Lighttpd: we will have less, but bigger requests. Some users will use download managers that create a number of HTTP range requests in parallel to optimize against bandwidth restrictions some providers operate with. We may or may not want to allow that, especially if our throughput is high. In that case each additional connection from one user will take resources away from all the others. On the other hand, we may want to allow range requests, to let our customers resume broken downloads.

If we want to serve large files, we need to set the write timeouts higher than usual—to compensate for the longer time the transfer will need. We may also want to use the writev network backend or one of the aio backends in the new version.

Note

Keep large content static

This message is probably obvious. But do not try serving large files dynamically. It just hogs our Lighttpd plus a backend job squeezes a large amount of bytes through two sockets or pipes.

主站蜘蛛池模板: 宝丰县| 禄丰县| 璧山县| 澜沧| 基隆市| 临潭县| 榆中县| 阳东县| 闸北区| 墨竹工卡县| 开封市| 正阳县| 尚义县| 康定县| 家居| 大邑县| 望江县| 印江| 新野县| 涿州市| 武威市| 三明市| 梧州市| 米泉市| 宣武区| 延安市| 库车县| 保定市| 平罗县| 敦煌市| 广宗县| 卢龙县| 循化| 汶上县| 洛扎县| 化德县| 盱眙县| 浠水县| 洞口县| 余干县| 定边县|