Troubleshooting page load speed, part 45…

December 20, 2016 3:31pm
Tagged with:

For the record, I’m painfully aware that the page load times on several of my sites have been, well, unbearable as of late!

Admittedly it’s a problem that I’ve been stalling on for some time now, despite the regular high load emails that I get from my server. A few days ago I got one saying it was as bad as a 5-minute load average of 68.94 … and this is on a VPS with three CPUs and 5 GB of RAM that does honestly pretty light traffic right now, unfortunately…

I had been hoping that most of it could be chalked up to an OS issue because I recently discovered that cPanel had stopped updating on me after reaching a version threshold where the latest would no longer run on 32-bit operating systems, which I was kind of surprised to learn that I had, but again, this VPS was setup back in 2012 so I suppose 32-bit could’ve still been the default four years ago.

The trouble is, there’s really no clean way to upgrade my server from 32- to 64-bit leaving everything intact, so it requires spinning up a new machine and migrating everything over to the newer OS.

Plus, the way I migrated four years ago to VPS from my plain, old shared hosting account of maybe eight years was using cPanel’s built-in account transfer features, which although made it incredibly easy (plus my host did most of the work!), lord only knows how much random garbage has accumulated in all of those files over 8 + 4 years of shared history!

So I had planned on making the migration sort of a clean-up effort along the way and only copy over the guts of each WordPress install, leaving behind whatever caches and other nonsense have accumulated over the years.

And then terrible performance got even worse!!!

When it got to the point where it would literally take upwards of a minute to move from one page on my blog to another, and the admin pages would randomly get disconnected because they couldn’t touch base with the server when it was super overloaded, I knew that it was time to finally tackle this pig. So within a few hours time, I created a second VPS with my awesome web host and gradually let it go through all of the OS and app updates while I staged just one install – my multisite that contains my blog, Thing-a-Day, and about half a dozen other sites – and everything seemed to be going fine…

…until I switched my domain over to the new server…

…upon which usage started blowing up like crazy, again despite little traffic, and even though I started this new VPS a bit smaller than my main server (figuring I could upgrade once I’m ready to stop paying for the old one), it quickly became unusable just like the old machine had been.

From here I started doing some digging into WordPress itself because no longer could I point fingers at the 32-bit OS. I downloaded a couple of plugins – P3 Profiler and Query Monitor – and with the latter’s help, that’s when I noticed that apparently I had a plugin that was just GOING NUTS against MySQL day and night:

To walk you through this fun graph, the orange is your normal SELECT queries that happen when anyone hits a page and WordPress queries its database to build it; the purple, on the other hand, is somehow all INSERT queries, which should really only ever happen when I’m publishing a new post, with a few exceptions.

And those two big valleys in the purple that you see around the 18th and then again between 19 and 20? The first is when I had temporarily pointed my domain over to the new server; the second is keeping the domain back on the old server, but turning off the plugin in question … which apparently solves just about everything!

By the way, the last little purple sliver is me turning the plugin back on so that I can capture some logs to send over to the plugin’s developer to help him look for a fix…

because the thing is, I actually really like this plugin – it’s called WP Word Count and I’ve used it on just about all of my sites for years and years to summarize how much writing I’ve put into my projects. I love it, and if I can spare the time next year, I want to make use of its work to pull together a running total of word counts for all of my work combined so that I can ultimately put together a fun, little dashboard to help motivate me to keep putting words on the screen!

Luckily after finding another multisite user with the same issue, I left a quick comment expressing the same and got a reply from the plugin’s developer later on that evening, so it’s awesome that they’re actively interested in patching this bug because I’ve evaluated a lot of other options and honestly never really found ones that I liked better than theirs.

In the meantime it’ll have to stay off, though, as I continue with my fun server migration. During this whole effort, I’m also trying to really hone in on The Perfect VPS WordPress Configuration, so I’m doing other things like tinkering with Varnish and considering adding Nginx in front of Apache, and then eventually I also want to fine tune W3 Total Cache so that I have one reliable set of caching / compression / minifying rules to use for all of the different sites that I publish … because I figure if I’ve seriously been doing this publishing on the web-thing for over fifteen years now, my pages should be some of the fastest loading around!

Stay tuned for more as I struggle through more issues to come! Now if I can only get this stupid thing to post… 😛

Leave a Reply

Your email address will not be published. Required fields are marked *

© 1999 - 2017 Comedic-Genius Media, All Rights Reserved.