Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Benchmark: Apache2 vs. Lighttpd (Static HTML Files) (howtoforge.com)
4 points by joschi on Sept 21, 2008 | hide | past | favorite | 9 comments


totally useless benchmark... yea, of course lighttpd is faster in standard configuration, but what if he would have turned off 20 or so useless apache mods that are not needed for a machine serving static requests? If you really want performance from apache you can make it very fast, and there's tons of different ways to have kick ass caching inside apache. Though I'd say that lighttpd is probably faster with tweaks. The reason to go for apache is battle tested stability, robustness and extensibility.


Actually, asymptotically (as you peel off the overhead) I'm sure they're in a dead tie. Ultimately, serving a static file consists of reading the header, opening the target file and calling the sendfile() syscall. The bulk of the work is obviously the data transfer, and on a modern OS that happens in the kernel. I have a hard time believing that any web server is going to significantly distinguish itself on the basis of header parsing, of all things.

And since when is service of static files a significant performance problem anyway? Unless you're youtube, this is the easy part of web application optimization.


Unfortunately, if you take a look at the Apache source code you'll see that a ton of hooks are inserted into the entire process all over the place, adding a ton of useless calls that don't benefit you anything in exchange for allowing certain uber-cool tricks to be done in the future by other devs, but unfortunately affecting their own bottom line.


I have read through the apache source, actually. If those hooks are disabled, they're just a branch not taken. Compared to the work of moving a 32k (or whatever) file through the page cache and out the network interface, it's just noise.

I'm not holding up apache as a model of clean code, mind you. Like all mature software, it's terribly crufty in places. I'm just saying that serving static files is something that even crufty software can do quickly. If you want to show up apache, this isn't the test to use.


it can still saturate a 1gb outbound link, so who cares?


Amen to that! Same thing could be said for MySQL vs Postgres benchmarks. I've been doing some research on the two and I have to say people at the SliceHost forum suggest that MySQL can rival Postgres if you turn off certain modules (like skipping InnoDB).


Not true - MySQL is faster than PostgreSQL, but PGSQL is faster under load.

What's being argued here is that there are no technical grounds for one application to be faster than the other - they're just sendfile() whatever is requested of them, which doesn't leave much room for speed differentiation.

On the other hand, database engines are very complicated beasts that do tons of stuff, each in their own way. There's lots of room for one to be faster or slower than the other depending on how they're designed, how they go about accomplishing something, and the tasks they're optimized for; in contrast with web servers where they all do the same basic task using the very same algorithms and APIs (for the most).


The benchmark is useless because the machine was testing itself.


pointless discussion. apache2 can saturate the typical outbound connection for static files. you can't push any more data than that. this is why people gave up on the linux kernel http daemon so long ago...its pointless.

in any case your static files should be on a cdn like akamai.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: