lighttpd works very well with static file hosting sites. If you serve small files like images, it work with very low server load and memory usage.
For image hosting, i use following configuration in
/etc/lighttpd/lighttpd.conf
server.max-keep-alive-requests = 4
server.max-keep-alive-idle = 4
server.event-handler = “linux-sysepoll”
server.network-backend = “linux-sendfile”
server.max-fds = 8192
server.stat-cache-engine = “fam”
Also use following values in /etc/sysctl.conf
# These ensure that TIME_WAIT ports either get reused or closed fast.
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_tw_recycle = 1# TCP memory
net.core.rmem_max = 16777216
net.core.rmem_default = 16777216
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 262144net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2# For Large File Hosting Servers
net.core.wmem_max = 1048576
net.ipv4.tcp_wmem = 4096 87380 524288
After editing sysctl.conf, reload the value with command
sysctl -p
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Dec | ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
One Response
lighttpd for image hosting « My Random Web Snippets
October 10th, 2008 at 2:42 pm
1[...] The following tuning did the job (thanks to the video sharing script) [...]
RSS feed for comments on this post · TrackBack URI
Leave a reply