If you ever experience the error ERR_INCOMPLETE_CHUNKED_ENCODING in WordPress (you should be able to find this in your Nginx error log) then you should check the following things:

  • Nginx and PHP-FPM should both be run as the same user
  • The directory /var/lib/nginx and all underlying directories should be chowned to that user

I my case Nginx and PHP-FPM were both running as Apache, but the directory /var/lib/nginx was owned by nginx:root. This meant the dir has to be chowned to apache:apache to fix the problem:

Don’t forget to restart nginx & php-fpm to be on the safe side.

Moved logo-centos-7distro again because I somehow managed to break MariaDB on Ubuntu.. So instead I’m back to Percona on CentOS, which I upgraded to v7 now. CentOS 7 WordPress with Percona and Redis! Mind you I am not running HHVM anymore so the site will be slower. Turns out there’s a memory leak when it comes to Crayon, the syntax highlighting plugin I use. I have to look for a nice caching solution, preferably using Redis..

UPDATE: Found my redis solution! https://github.com/BenjaminAdams/wp-redis-cache
Without being logged in the blog loads in 13ms now, that’s even faster than varnish 🙂

UPDATE: Turns out I was overloading my VPS and the dreaded OOM killer struck and killed Percona. So I’ve upgraded to a 2GB VPS and I’ve added DataDog monitoring to Nginx, Percona and Redis just to see what’s going on. Here’s an example of my dashboard at DataDog. It’s a bit of a build it yourself NewRelic and free up to 5 hosts!

 

 

Just added Varnish to the config of this server and the blog should now be loading within 30ms 🙂
This is just a test post to see if cache is purged on new posts.

UPDATE: Works just fine! Now to minify css & js and add expire headers to all statics (if they aren’t set yet) in nginx.
UPDATE2: So the blog is fully minified and expire headers are being set. Varnish is running in front of it and if you’re lucky you will see response times of around 12ms 🙂