Monday, 22 December 2014

Speed up your Wordpress 1.000x with REDIS

I was bored so I decided it was time to upgrade my server with new distro and switch to NGIX. My current installation was Debina6 PHP5.3 running Lighty web server. My typical cached server response was around 1s. Considering my server uses 12 CPUs this was really bad. But the page load is low and I didn't care to much:)

Having problem with
apt-get dist-upgrade 
in the past I decided rather to install fresh version of debian/jessi
 I like jesse because I got accustomed with systemd and jessie is finnaly on board with it.
I decided that I will also cut down on number of CPUs down to just 4 (AMD Buldozer 2Ghz) and 4Gb of ram.

So my new LAMP stack is now LNMP. Just migrating to NGINX and enabling OPCache the typical response time became 3-4x faster on 3x less CPUs. I didn't bother with server load at this point since this was just learning exercise.

Now my page load time was about 300ms. Things are getting brighter I thought.

But I was not happy yet. I found a great tutorial on how to configure Wordpress to use REDIS

https://www.rosehosting.com/blog/install-and-run-wordpress-cached-with-redis-on-linux-vps/

I don't like caching plugins like W3C because It has so much overhead and I like to use as few plugins as possible. Wordpress core is really great but plugins... Plugins are hell:)

Redis implementation to wordpress was however almost trivial. I took me 30 minutes to set thing up and push changes to production. And now a bomb shell.

 Page generated in ~0.84239 seconds Apache without php cache

Page generated in 0.34239 seconds  NGIX with OPCache

Page generated in 0.00084 seconds !!! NGIX wit OPCache and REDIS

I took just a few hours with almost no effort to archive 1.000x faster page load.

So to paraphrase Microsoft 365 commercial. UPGRADE UPGRADE UPGRADE




No comments:

Post a Comment