Twilight SEO

Standing at the border line. Beautiful color spectrum of Search Engine Optimization. White, Gray, Black Hat SEO learning by doing.

Lighttpd vs Nginx (Apache Benchmark)

Posted in server by ruru on the March 21st, 2009

lighttpd-vs-nginx-apache-benchmarkContinuing previous post Lighttp vs Apache2
Now, i’ve done another test Lighttpd vs Nginx using Apache Benchmark

Benchmark parameter

ab -c 300 -n 1000 …

.
.
.
.
.
Nginx + spawn-fcgi
14:31:34 up 9 days, 21:39, 2 users, load average: 18.47, 7.77, 5.68

Server Software: nginx/0.6.35

Document Path: /
Document Length: 22355 bytes

Concurrency Level: 300
Time taken for tests: 45.095 seconds
Complete requests: 1000
Failed requests: 120
(Connect: 0, Receive: 0, Length: 120, Exceptions: 0)

Write errors: 0
Non-2xx responses: 119
Total transferred: 19941669 bytes
HTML transferred: 19740333 bytes
Requests per second: 22.18 [#/sec] (mean)
Time per request: 13528.485 [ms] (mean)
Time per request: 45.095 [ms] (mean, across all concurrent requests)
Transfer rate: 431.85 [Kbytes/sec] received

Lighttpd + spawn-fcgi
14:47:53 up 9 days, 21:55, 2 users, load average: 21.21, 6.73, 4.57

Server Software: lighttpd/1.4.22

Document Path: /
Document Length: 22388 bytes

Concurrency Level: 300
Time taken for tests: 42.815 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 22599690 bytes
HTML transferred: 22388000 bytes
Requests per second: 23.36 [#/sec] (mean)
Time per request: 12844.583 [ms] (mean)
Time per request: 42.815 [ms] (mean, across all concurrent requests)
Transfer rate: 515.47 [Kbytes/sec] received

Conclusion: Lighttpd vs Nginx (Apache Benchmark)

Lighttpd gave me less error and slightly faster.

Nginx consume less resource, with slightly produce more error.
Setting low amount of worker thread will greatly reduce resource usage,
but couldn’t serve high concurrency.

Recommendation:

  • Use Nginx for Desktop based server,
  • and Lighttpd for Normal server.
  • Throw away ApacheĀ  :p

Edit:
I found the culprit that cause many errors on nginx was actually the spawn-fcgi parameters.
Nginx itself works smoothly beyond expectation.

I remark the conclusion. Both are great Apache2 replacement.

But, so far…
I coudn’t find a good numbers of childs to spawn and fork.
With nginx, it either crash my server (too high) or many failed requests (too low).

end of file … Lighttpd vs Nginx (Apache Benchmark)

2 Responses to 'Lighttpd vs Nginx (Apache Benchmark)'

Subscribe to comments with RSS or TrackBack to 'Lighttpd vs Nginx (Apache Benchmark)'.

  1. anton said,

    on March 22nd, 2009 at 11:00 pm

    nginx has more handy config file syntax than lighttpd (nginx config is more easy to maintain). Preformance difference is insignificant, and choice between nginx and lighttpd should be done based on features, not performance.

  2. ruru said,

    on March 23rd, 2009 at 4:19 am

    Thanks. It’s true. Not much difference in performance.

Leave a Reply




Cannot find your answer here?
Feel free to get in touch and ask PHP-ist anything, just anything :)