Which web server would be more suitable for running a few instances of wordpress?

They are both pretty easy to setup, so I am wondering mostly about performance. Would there be a difference? I think nginx is faster for serving static files.

migrated from superuser.com Jan 2 '10 at 9:13

This question came from our site for computer enthusiasts and power users.

  • Cherokee seems to be pretty fast too and it has excellent FastCGI capabilities. – wzzrd Jan 2 '10 at 14:32
  • Just curious, why have you excluded Apache? nginx and lighttpd have gotten a lot of press recently for their ability to serve static content, but Apache is really the standard for serving PHP applications. I'd focus more on which PHP caching engine to use (eAccelerator, for example) and which Wordpress caching module to use (i.e. wp-supercache). edit: I see that others have already brought up all these points below. – Aaron Brown Jan 2 '10 at 17:24

I'd go with nginx, because I think it's a better long-term solution than lighttpd, and it's configuration format doesn't make me want to buy up stock in parentheses supply companies. As gekkz says, Wordpress is a dynamic app, so static file serving isn't the best benchmark to be relying on. I'd rate nginx's FastCGI proxying capabilities over lighty's too, though, and it doesn't leak like a sieve. For me, it's RIP lighty all the way these days.

  • Do you have a benchmark or something that shows nginx's fastcgi speed over lighty's? I'd be interested in that since php would be the bottleneck. – sybreon Jan 2 '10 at 11:17

Nginx is pretty fast for static files, but wordpress isn't all that static, unless you host your own media instead of using free image hosting services, in which case you might see nginx perform better than lighttpd.

Ideally, you would want to set up a caching plugin with your wordpress to decrease the number of DB queries, in which case both of them will be pretty much just as fast.


Barry Abrahamson says "For dynamic content, all of them are about the same performance-wise. There are some other advantages to using something like nginx + php-fpm. For example, php-fpm allows you to set some wall-clock timers for php processess (as opposed to cpu-time) at which you can either log and/or kill a php process after a certain amount of time. This is helpful for example, when a php process hangs opening a connection to a remote site. Apache + mod_php can’t do this."



Honestly either should perform fine. Apache would as well, it's far better then most people give it credit for, once some of the default features are turned off (.htaccess being the worst) it's fine, and with mod_php and a good opcode cache likely faster then a naive configuration of the others.

  • Unless you are getting massive hits, any webserver will work fine. Even with massive hits, simply enabling a caching plugin will useless drop the load way way down. – Ryaner Jan 2 '10 at 13:43
  • For the same load, nginx or lighttpd both have much better resource usage than Apache. – womble Jan 2 '10 at 13:55
  • @womble Do you actually have any proof? I've run boxes doing ~36M requests a day on Apache2 using almost the default settings without issue, and Apache wasn't the bottleneck on that machine. – LapTop006 Jan 2 '10 at 13:57

My last company I built a site that got 400M/day on a couple apache servers (not wordpress though)... The speed is negligible, and I find that the ease of apache and its ability to work with everything out ways any slight speed gains.

You need to recompile it with mpm=worker though when you get in the high millions.

For wordpress, make sure you have the wordpress "supercache" module if you expect any sort of high load.

  • You also need to recompile PHP to be thread safe if you use Apache mpm_worker. – Aaron Brown Jan 2 '10 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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