6 ms·
Speed Up a WordPress Website in 8 Steps
- fowkswe 10y agoThis fails to mention the most dramatic fix, which is to host it on NGINX rather than Apache.
- NicoJuicy 10y agoNot only that, but every time a page load happens. There is a cronjob that gets executed. You can seperate the cronjob by executing it by duration ( a real cronjob), instead of executing it every page load.
- alexpatin 10y agoThank you for mentioning this. I wish people understood this better.
- blakesterz 10y agoOh? How big of a difference does that make? I'm not even sure what to measure? I can host 100 WP sites that generate a total of 100000 hits in a day using Apache requires X RAM and X Cores but using NGINX I could do that with only X RAM and R Cores? Did you find something like that? I'd love to squeeze more out of what I have if I can do it with NGNIX.
- fowkswe 10y agoI don't have specifics like that, but I've noticed drastic improvements in page load time when I moved a site from Apache to NGINX. This post was the motivation: http://reviewsignal.com/blog/2014/06/25/40-million-hits-a-day-on-wordpress-using-a-10-vps/ http://reviewsignal.com/blog/2014/06/25/40-million-hits-a-da...
- ohashi 10y agoOh that's mine :) Glad it was a motivator. There are surely better configs out there now with a lot more resources behind them like easyengine.
- SahAssar 10y agoNginx vs properly configured apache makes little difference on for a small-to-medium site. What makes a difference is fastcgi caching, it's an important difference.
- falcolas 10y agoAgreed. An overloaded WordPress site with a minimal 5 minute page cache can now handle a HN storm. Throw in a CDN for the static assets, disable commenting, and it could likely handle the front page of Reddit. Amazing how fast a site becomes when it's no longer recalculating every response.
- benbristow 10y agoFor commenting you can always use Disqus which would take the load off your database.
- Veratyr 10y agoWhat are your thoughts on https://help.dreamhost.com/hc/en-us/articles/215945987-Web-server-performance-comparison https://help.dreamhost.com/hc/en-us/articles/215945987-Web-s..., which seems to say otherwise? Likely configured wrong?
- joaoperibeiro 10y agoGood tip! Added to the post
- RachelF 10y agoAlso fails to mention enabling SSL which shortens load times. This might not be an option for those on free Cloudflare plans, though.
- RKearney 10y agoTLS comes with the free Cloudflare plans.
- throwawaydbfif 10y agoWordPress is garbage unless you statically cache the generated html. I haven't been able to keep the servers running on even medium traffic sites doing anything else. It's simply far too slow. On anything short of a supercomputer you can get about ten requests per second with the stock setup and zero content/plugins. Adding anything to the site just makes that number worse. My rule has become don't use WordPress for anything but html generation. It's not a serious CMS for anything else
- blakesterz 10y agoI'm curious what does a "medium traffic site" mean? I feel like I have a bunch of what I'd call "medium traffic sites" and I've not had much of a problem with them. Though, maybe my "medium" is actually "small"? Is there a general rule of thumb for site traffic? Like a "medium traffic site" gets X Hits, or whatever?
- brianwawok 10y ago100 requests / sec average seems medium traffic to me (and outside the bounds of wordpress live)
- ac29 10y ago8.6 million requests/day is only medium traffic?
- brianwawok 10y agoSure. Well let's call it 1 million per day peaking at 100 req/sec... not many websites are steady state 24/7 But this is orders of magnitude below what a Google or Espn or Amazon do. But orders of magnitude over what 1 PHP server can do. (But oddly enough, within the realm of possibility for a good Java or Go or Rust server)
- NYMD 10y ago
- mwpmaybe 10y agoI recently wrote up my Caddy+Varnish+PHP-FPM solution for WordPress[0]. It's fairly complementary to the steps detailed in the OP. The site absolutely flies now: 50-75ms response times cf. 200-300ms per Google, A+ on SSL Labs cf. unencrypted HTTP/1.1, and the $10/mo VPS rarely cracks 1% CPU utilization despite it being a modestly well-trafficked site. Our organic search position has improved significantly. Caddy was maybe an odd choice but it performs well and it's been a breath of fresh air after dealing with some gnarly NGINX and Apache configurations in the past. So far it's been easy to maintain and there's a clear CDN migration path (Fastly). I'm using Docker's official PHP-FPM images[1] to serve multiple sites with some isolation, sharing Caddy, Varnish, and MariaDB instances. I'm not sure if this solution has value for anyone else but I've been plugging it here and there in case there is! 0. https://gist.github.com/mwpastore/f42f6f1309a7b067519f4c08e18b0b6a https://gist.github.com/mwpastore/f42f6f1309a7b067519f4c08e1... 1. https://hub.docker.com/_/php/ https://hub.docker.com/_/php/
- basch 10y agohave you tested what happens if you substitute in HHVM
- mwpmaybe 10y agoI have not. The whole purpose of an architecture like this is to turn WordPress into a glorified static site generator, so it doesn't particularly matter how fast (or slow) the application server is. At any rate, I thought PHP 7 was about as fast as (and even faster than, in some cases) HHVM?