- Lighttpd
- Andre Bogus
- 427字
- 2021-08-25 18:06:23
Core Settings
Using this scenario as a starting point, we will enumerate the knobs to be turned. Here are some configuration settings that will make our Lighttpd serve large files faster and more reliably than the defaults. First, we make sure range requests are enabled using the following command:
# if we have disabled range requests for some reason: server.range-requests = "enable"
We want to use the optimal network backend for sending out content. If in doubt, take a file of the size we want to serve or create (for example, we can use dd
to create a 1GB file):
$ dd if=/dev/zero of=our_file bs=1024 count=10480576
Now, put this file into our document root and run an http_load
test (refer to Chapter 9 for further details) with each network backend that we get to run. Then, pick the fastest network backend. Probably it is one of the following, depending on your system. Take your pick and be sure to test on our system; when in doubt, test all of them:
server.backend = "writev" # optimal for 1.4 versions server.backend = "posix-aio" # the fastest for large files server.backend = "gthread-aio" # using threads to multiplex server.backend = "linux-aio-sendfile" # optimized for linux
In the next step, ramp up the idle write timeouts:
server.max-write-idle = 720 # double to 12 minutes.
This allows clients to keep a connection-on-hold a little longer, which they might do for any old reason (for example, their network might be down for a second), without killing their download. On the other hand, we might want to reduce the maximum keep-alive requests to free up connections sooner (because we will not have as many requests, but the ones we have will last longer):
server.max-keepalive-requests = 8 # half the requests # if we have a different setting than the default, set server.max-keepalive-idle = 5 # seconds
This should be all it needs to make our Lighttpd large-file friendly. Note that some of the settings may be pessimizations in other scenarios, for example, say some small requests. Therefore, we might want to limit the impact of these options to where we need them.
- Photoshop+Camera Raw風光、人文、城市、星空攝影后期技法(全彩)
- 自己動手寫分布式搜索引擎
- 從零開始:Photoshop CC中文版基礎培訓教程
- Painter繪畫實例教程
- 使用AADL的模型基工程:SAE體系結構分析和設計語言入門
- SolidWorks 2008機械設計一冊通
- Photoshop CS6從入門到精通
- SolidWorks2014基礎實例教程
- Photoshop插畫藝術火星風暴
- Adobe創意大學InDesign產品專家認證標準教材(CS6修訂版)
- NX Open API編程技術
- 構筑敏捷的開發團隊:微軟Visual Studio 2010實戰兵法
- Adobe創意大學Premiere Pro影視剪輯師標準實訓教材(CS6修訂版)
- Photoshop CS5數字圖像處理
- UG NX 12.0完全自學手冊(第4版)