Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Youtube use lighttpd rather than the common Apache. What are the advantages of Light vs Apache? Are there other alternatives to Apache?

share|improve this question
5  
OMFG! Microsoft runs on IIS! Where will the insanity end?! –  Mark Henderson Oct 7 '09 at 9:06
add comment

closed as not constructive by womble, John Gardeniers, Sam, mrdenny Oct 7 '09 at 15:56

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

6 Answers

up vote 13 down vote accepted

YouTube uses lighttpd only for its static assets (like images and videos). The main site is still using Apache httpd:

$ lynx -head -dump http://www.youtube.com|grep ^Server
Server: Apache

There are several reasons for using a more lightweight webserver than Apache httpd one being that they could be more efficient in serving static files. An interesting source of information about YouTube's architecture can be found on highscalability.com

It might surprise you, but there are several more companies using webservers other than Apache httpd. Take a look at the Netcraft web server survey or the lighttpd wiki for examples.

share|improve this answer
2  
+1 for the use of lynx+grep. :-) Oh, and the good info. –  T.J. Crowder Oct 7 '09 at 10:49
add comment

Apache is a very featureful and extendable webserver. In most instances, you would want to use Apache.

Lighttpd is smaller and quicker, because it doesn't have all the features that Apache does. You would want to use it on a very large scale website. I would imagine that, given you're asking this question, you do not run any sites where this would be the case. In particular it's useful for serving static files and applications that run under fastcgi.

Lighttpd uses less resources because of the way it runs. Apache can run in either a forked mode, creating a new process for every request, or in a threaded mode, where each request runs in a thread in a couple of processes. In lighttpd, there is a single process and it uses an event-loop, using epoll()/kqueue() to process requests.

share|improve this answer
    
Lighttpd defaults to running everything in a single process, but it can be configured to use multiple child worker processes. There are some good reasons for doing so at redmine.lighttpd.net/projects/lighttpd/wiki/Docs:MultiProcessor. –  James Sneeringer Oct 7 '09 at 15:26
add comment

Lighthttpd uses a lot less system resources. It has fewer features.

share|improve this answer
1  
I think this is much oversimplified. Stripping it of most of its modules and using the right MPM, Apache httpd can also perform very well and use few resources. –  joschi Oct 7 '09 at 13:24
add comment

You might want to Google for a bit of info. If you'd run a benchmark, in most cases Lighttpd will be somewhat faster, but indeed have has less features.

share|improve this answer
add comment

I prefer lighttpd to apache. Some things such as FastCGI are simply better implemented, my guess since they don't have to drag around as much legacy garbage.

As other comments have said, other big sites also run lighttpd.

share|improve this answer
add comment

-1 for a shallow and thoughtless question written in a childish manner.

However this link should help you: http://www.google.com/search?q=apache+vs+lighttpd

share|improve this answer
2  
+1 for accurate description, -0.5 for using TinyURL, -0.5 for using it for LMGTFY, -1 for misspeling vs –  grawity Oct 7 '09 at 11:54
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.