WordPress.org

Ready to get started?Download WordPress

Forums

Pros/cons of using nginx? Questions for people who know nginx + WordPress (3 posts)

  1. KatieBen
    Member
    Posted 2 years ago #

    Hi -

    I'm moving to a dedicated host from a VPS because of load issues, and considering a switch to nginx in the process. I'm not an experienced server admin - when I need to do anything with a server, I just find instructions online and follow them. Nginx is appealing for the performance upgrade, though I'm concerned that I might be in the dark when facing any issues with it.

    To those in WP.org-land who know something about WP + nginx - how easy is this to setup and maintain? What are the issues you run into when using WP + nginx? I'm using BuddyPress, with multisite/subdomains - anyone out there happily using a similar setup on nginx? Do you consider the performance upgrade truly dramatic enough to warrant moving from Apache?

    Thanks. :)

  2. Andrew Nacin
    Lead Developer
    Posted 2 years ago #

    I'm currently using nginx for nacin.com. If you're not an experienced server admin, I would consider sticking with nginx as a frontend proxy for Apache, ideally set up to handle microcaching.

    What this means is that all requests would go to nginx, and if it can't handle it (as would be the case for anything non-static, depending on how you configure it), it would use a try_files statement to pass everything to Apache.

    Microcaching is a really interesting concept that is easiest to do in nginx when you're using nginx as a proxy. Essentially, nginx will create a temporary page cache and serve it if the same page is requested again within, say, 5 seconds. It's very, very efficient. If a single page gets nailed, nginx can serve it at thousands of times per second, and Apache won't notice much. You could scale up a VPS very easily with this.

    But instead of asking "nginx?" I think you should ask "Why can't my server support the load?" Focus on the problem, not the solution. Given that you are running BuddyPress and multisite, you absolutely should be configuring a persistent object cache, such as APC or Memcached. Do you need more memory? Are your CPU load averages through the roof? What kind of load is your site getting? Is it steady traffic across the site, or is it at peak times for particular pages? Anonymous users, or logged-in users (which means less opportunities to cache)? Lots of questions.

  3. KatieBen
    Member
    Posted 2 years ago #

    Awesome - thanks so much for the pointers, I'll see where I can go with this. :)

Topic Closed

This topic has been closed to new replies.

About this Topic