Lighttpd performance

We use Lighttpd a lot these days to offload our Apache2 servers. More specific we use Lighttpd to serve all the static content (images, stylesheets, javascript files and such).

Since one of our customers wanted a clear view I did some performance testing. I used siege with 500 concurrent connections with a list of urls with all the available static files (little over 3000 files).

The results:

Lifting the server siege... done.
Transactions: 279582 hits
Availability: 100.00 %
Elapsed time: 300.51 secs
Data transferred: 2401.35 MB
Response time: 0.03 secs
Transaction rate: 930.36 trans/sec
Throughput: 7.99 MB/sec
Concurrency: 27.50
Successful transactions: 279499
Failed transactions: 0
Longest transaction: 3.20
Shortest transaction: 0.00

While sending out with a rate around 80Mbit and receiving around 7Mbit, the old Xeon server didn’t get over a load of 0.20.

I knew lighttpd was good at its job, but this still surprised me positively. I didn’t try to push it any futher but I would expect the server could have saturated a 1Gbit/s link if you look at these results. I bet Apache2 would not be able to come even close.

No related posts.

Leave a comment

9 Comments.

  1. Have a look at thttpd, as well. It’s a fantastic, small, and resource-light httpd.

  2. You try compare nginx and lighttpd?

  3. You should also check out nginx. A very small asynchronous httpd. I use it to serve media files and proxy python web apps.

  4. Hermann,

    lighty is very nice…but I wonder about the 500 concurrent user requests, because your result says:

    Concurrency: 27.50

    Which means, that lighty only servered 28 concurrent requests..
    Did you start siege on more then one client computer to stress your lighty server?

    Curious,
    \\sh

  5. Hermann,

    lighty is very nice…but I wonder about the 500 concurrent user requests, because your result says:

    Concurrency: 27.50

    Which means, that lighty only servered 28 concurrent requests..
    Did you start siege on more then one client computer to stress your lighty server?

    Curious,
    \sh

    PS: this is the second time I entered the comment and I wonder if it’s in the moderation queue or whereever ;)

  6. \sh,

    I noticed the same. I started siege with option -c 500. So I guess the concurrency number in the results is different.

    I also saved the results of a run with -c 100. See below:

    Lifting the server siege... done.
    Transactions: 57843 hits
    Availability: 100.00 %
    Elapsed time: 299.74 secs
    Data transferred: 495.45 MB
    Response time: 0.02 secs
    Transaction rate: 192.98 trans/sec
    Throughput: 1.65 MB/sec
    Concurrency: 3.34
    Successful transactions: 57827
    Failed transactions: 0
    Longest transaction: 3.03
    Shortest transaction: 0.00

  7. Herman,

    For my stresstests I was using all the time the “ab” utility of apache utils. But I’ll test siege in the next few days, let’s see how the results are differing between siege and ab2.

    But as you said, lighty is one of the fastest httpd servers around.
    While I was serving my local package mirror on my buildserver with lighty, it was quite impossible that my hardware was coming behind lighty…apache2 is somewhat slower but better suited for lowend machines, while lighty can do a lot of speed magic to your static http servers. that’s why services like youtube or myspace are using it to serve their static files :)

    Regards,

    \sh

  8. so you “suppose” that apache wouldn’t come close but you didn’t try.
    yet you should. apache is actually very fast as well when properly configured !
    simply has a bigger installation than lighttpd and others (that is, many modules, big config etc, in that way, lighttpd and others are indeed *lighter*)
    but not in speed, regardless or whatever developers want to make you believe.
    khttpd used to be faster tho for technical reasons.

  9. @bleh:

    Apache is fast..and it’s actually good in serving dynamic webapps..
    but even compared to e.g. lighttpd + php (as fcgi engine) apache comes behind lighty.
    Regarding the support of the broader php audience, apache is indeed the first choice…but for static content, as e.g. youtube videos or images or videos .. lighty is very much faster..really.

    we are running both webservers..apache for the dynamic stuff, and lighty for the static stuff.

Leave a Reply


[ Ctrl + Enter ]