3

[First, please read it all before marking it as being subjective, or irrelevant as of ServerFault's community guidelines.]

EDIT: I should have mentioned that the site I am building serves video files. It's a video sharing site.

Coming to the point, I plan to use Apache web server for serving dynamic content, and Lighttpd for serving static content like cached HTML, images, css, and js files, among others.

There's one small problem. I see that Lighttpd had some serious memory leak issues, and all those date back to a year or two ago. No talking about it recently. I would be very grateful if someone can clarify my doubts:

  • Does Lighttpd still suffer from these issues, or are these issues really subjective of a particular environment? (yes, I've read this bug report)

  • Do Lighttpd's memory leak issues apply when it's serving static content as well? (Most of those complaining are employing Lighttpd to serve dynamic content.)

  • From this benchmark test (by someone), I see that Lighttpd is probably the best web server around for serving static content. True? or is Nginx much more comparable in performance than shown in the benchmark test I linked to?

I am in need of some clarification. I do not intend to cause yet another THIS vs THAT flame war. I'd would appreciate your understanding, if my question isn't properly put.

5 Answers5

2

No it does not.

I explain what is the "problem"

Lighttpd caches the response of the FastCGI server and if the fastcgi server tries to send huge files as is lighttpd allocates memory. The solution is not to serve huge files via FastCGI directly (like video streams) but let lighttpd to do the job using X-Send-File.

See: http://redmine.lighttpd.net/boards/2/topics/4009

Artyom
  • 754
  • 2
  • 7
  • 16
1

Have you considered using LiteSpeed?

If your goal is to handle more concurrent connections, this might save you some money and reduce the headache of handling two different web servers.

A customer of mine saved a lot of money by using LiteSpeed instead of purchasing more hardware.

Mascarpone
  • 872
  • 3
  • 9
  • 28
  • Sorry, no. I want my project to be built and run from everything open source, unless when there's no way out. (And thanks for trying to help, I'll save that suggestion for later.) –  Nov 12 '11 at 19:41
1

This is anecdotal only, but a pair of static-content-only lighttpd servers that I set up 2.5 years ago has never had an issue.

Not terribly high load, probably 25-50 requests/sec, but the lighttpd processes have probably cleared a year of uptime without a service restart - certainly no evidence of any memory leak in that deployment.

Shane Madden
  • 114,520
  • 13
  • 181
  • 251
1

Honestly. You'll be better off using Nginx than Lighttpd. You need only look at the development pace of the two to know that Lighttpd is past it's time of glory. 2 years ago it might have been close but these days I would never ever use lighttpd over Nginx.

Cherokee is an option but I haven't ever messed with it so I can't say anything about it. I can say that the benchmark you linked is inaccurate, though. There's absolutely no way lighttpd is 1/3rd faster than Nginx, you'd have to seriously misconfigure Nginx to get those numbers.

Matthew Rankin
  • 1,175
  • 5
  • 15
  • 32
Martin Fjordvald
  • 7,749
  • 1
  • 30
  • 35
  • Is Nginx's performance faster or at least comparable to Lighttpd and Cherokee for serving videos? I thought Lighttpd is a good choice because YouTube uses it. (I have updated my Question.) –  Nov 12 '11 at 21:39
  • 1
    video is just static files like everything else. Both Nginx and Lighttpd have such small footprints that they're not going to be your bottleneck. You should focus on the hardware in your server instead of on your webserver. Of course, if you want to stream it then Nginx has a handy mp4/flv streaming module. – Martin Fjordvald Nov 13 '11 at 03:07
  • 1
    "but these days I would never ever use lighttpd over Nginx" you forget several basic things that nginx missing as: handling CGI, starting fastcgi processes, normal support of `PATH_INFO` by default, not-broken support of Status headers in SCGI protocol. More? Nginx is good as reverse proxy and for serving static content but it is very bad for handling dynamic content. – Artyom Jan 29 '12 at 10:04
  • Artyom. thats quite subjective (personally i would simply say wrong). E.g. nginx is nowadays the webserver of choice for php applications – AD7six Jan 29 '12 at 16:56
1

Lighttpd has the merit to be a lot easier to configure for most of the sites and is incredibly stable, I have been using it on a vps with no issues at all.

Nginx on the other hand is a pain to set up, you have to understand how the stuff works in order to make it work and it's not always done that easy, I don't need to learn about fastcgi scripts, nor virtual hosting nor fpm-php when my aim is simply to put my php based site on-line.