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.

I'm looking for the fastest http server available for:

  1. serving static content -- huge set of large images. Minimal features need, just as fast as possible.

  2. dispatching dynamic content plugins -- think a web server that does on-the-fly watermarking or image transcoding. I'm looking for the fastest, lowest-overhead way of dispatching this.

Environment: linux or OS/X. any language acceptable.

share|improve this question

migrated from stackoverflow.com Nov 20 '09 at 18:58

This question came from our site for professional and enthusiast programmers.

    
why does the water-marking have to be "on-the-fly"? Couldn't images be processed server-side outside the webapp to add/remove the watermark, and then just serve the proper image to the site? –  warren Aug 17 '10 at 15:12

7 Answers 7

up vote 5 down vote accepted

serving static content -- huge set of large images. Minimal features need, just as fast as possible.

nginx is the current favored choice. LigHTTPd still works fine, but is less actively developed nowadays. LiteSpeed is also a good choice, and may be the best if you want commercial support or a nicer GUI. All of these are very fast, raw speed will not be a meaningful competitive differentiator within this group of webservers.

dispatching dynamic content plugins -- think a web server that does on-the-fly watermarking or image transcoding. I'm looking for the fastest, lowest-overhead way of dispatching this.

Hmnn, a custom extension module to nginx is the lowest overhead option. But writing modules in C / C++ is seriously time-consuming. OP says "any language acceptable", well, if that is so then nginx with a C extension, or maybe Apache with a C extension to benefit from Apache's richer set of modules and documentation.

But realistically, who writes C code today for non-mass-market products? I would consider Python code with Tornado, or a similar event-driven webserver in a high-level language to be a better match.

share|improve this answer
    
C or C++ is no problem... my current code base is a C-level apache module. –  Mark Harrison Nov 20 '09 at 21:28
    
In that case, I'd imagine that a port to nginx wouldn't be the end of the world. –  womble Nov 20 '09 at 21:35
    
@Mark: Well, in that case, have a look at the 3rd party modules for nginx that I linked to above, for inspiration... And do the math of course, while nginx is fast, it may not be so much faster that it justifies porting over code that already works on Apache. –  Jesper Mortensen Nov 21 '09 at 8:21
    
@Mark: See this presentation on nginx internals: slideshare.net/joshzhu/nginx-internals It was linked from this so-so thread: serverfault.com/questions/86674/why-is-nginx-so-fast –  Jesper Mortensen Nov 21 '09 at 9:47

Choose between lighttpd and nginx for static content. Choose Apache with modules that do in-house fastcgi process management efficiently (*mod_fcgid*, *mod_wsgi*, *mod_passenger*) for generating the dynamic content.

share|improve this answer

One solution would be nginx + php-fpm + apc. It'll handle static content and it'll handle dynamic content pretty f'ing quickly, too.

It's also worth noting that nginx has plugins, as well, and you could always write a plugin that did the watermarking. Doing it that way is probably the fastest possible way, although not the simplest to build.

Here's an example module that uses libgd: http://wiki.nginx.org/NginxHttpImageFilterModule

There's no reason you couldn't modify it to spit out watermarked images instead...

share|improve this answer

My faster Web Server podium is :

1) Nginx

2) Lighttpd

3) Cherokee

Here some benchmark : http://www.cherokee-project.com/benchmarks.html

http://www.rkblog.rk.edu.pl/w/p/lighttpd-and-cherokee-benchmark/

http://www.rkblog.rk.edu.pl/w/p/pylons-benchmark-various-servers/

Cherokee is fast and simple to configure, for this maybe is the better choice.

share|improve this answer

Perhaps lighttpd, but I'm not sure about the watermark part.

share|improve this answer
2  
Watermarking would be passed off to an external process, I'd imagine (or hope). I used to use lighttpd a lot, but I'm not a huge fan of it any more, I think nginx has taken over it's niche. –  womble Nov 20 '09 at 19:12

If your talking about the fastest/easiest web server to setup, i'd point to HFS File Server . It doesn't support anything but static content, but its SOOOO easy to use.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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