Sluggish wordpress


#1

Hey everyone! My WP site used to work just fine until not too long ago. I didn’t even touch it for a few weeks and then I noticed it had started going slow out of the blue. I’ve been trying to optimize the database, compress images, minifying scripts, etc, even using a CDM, but haven’t had much success so far.
Since I didn’t do anything before it got so slow, I can’t help but feel like this is some way to push me to choose Dreampress insted of my simple web hosting, but I do need to use FTP and upload some static pages every now and then.

Any ideas on what else I could do?


#2

You don’t mention caching. Do you have WP Super Cache (or another cache plugin) active?


#3

Yeap, got Cloudflare


#4

I don’t use Cloudflare myself, but my understanding is that by default they don’t cache HTML at all (they do cache images/styles/etc). That means that slow WP page-generation will slow down Cloudflare-served pages. Have you configured Cloudflare to cache HTML?

If it’s possible, you might let us know the URL of your WP site? I can think of lots of reasons why a WP site might slow down, but it is hard to know what is going on without specifics. Possibilities include:

  • heavy load on shared server (check uptime)
  • Change in CDN performance
  • WP auto-upgrade causing problems or interacting badly with plugins
  • Recent Trusty upgrade interacting badly with plugin or custom code
  • 3rd party Javascript CDN performance problems
  • WP install hacked
  • heavy traffic on un-cached WP site
  • etc

Just as a base benchmark, I find that a basic WP site with Super-Cache enabled can serve their blog page in ~30ms (median, first hit is longer due to DNS, etc) on Dreamhost’s shared servers. Static sites pages are about the same.

Without Super-Cache, page-generation takes 10-20 times longer, with a lot of variation. Typically 500-1500ms.

Here’s the command I run on the site’s shared server. Run several times to see median:

$ time curl -s https://blog.example.com > /dev/null

real	0m0.027s

#5

Site’s ivanfhagar.com

ivan@BB8:~$ time curl -s http://ivanfhagar.com > /dev/null

real    0m3.863s
user    0m0.016s
sys     0m0.016s
ivan@BB8:~$ time curl -s http://ivanfhagar.com > /dev/null

real    0m1.771s
user    0m0.000s
sys     0m0.047s
ivan@BB8:~$ time curl -s http://ivanfhagar.com > /dev/null

real    0m1.696s
user    0m0.016s
sys     0m0.000s
ivan@BB8:~$ time curl -s http://ivanfhagar.com > /dev/null

real    0m1.723s
user    0m0.000s
sys     0m0.031s
ivan@BB8:~$ time curl -s http://ivanfhagar.com > /dev/null

real    0m1.722s
user    0m0.000s
sys     0m0.016s
ivan@BB8:~$

I think I’ll try WP Super Cache and see whether it makes a difference!


#6

Great, thanks for the info. Keep in mind that the timings you see will depend on your connection and how far you are from Cloudflare’s servers.

For example, on a cable modem in the finger-lakes region of North America, I’m typically seeing ~300ms to your site. That’s about the same timing I see to my WP site (with Super-Cache), which is 300 miles (480 km) away at Dreamhost’s east-coast data center.

$ time curl -s http://ivanfhagar.com > /dev/null

real	0m0.302s

It is useful to compare a WP generated HTML page with a purely static file, like a CSS stylesheet. Ideally, there should only be a small difference between the two. At the moment I see a ~100ms difference:

$ time curl -s http://ivanfhagar.com/res/wp-content/themes/dyad-2-wpcom/style.css > /dev/null

real	0m0.185s

#7

Yeah, it definitely got much better once I got WP Super Cache running, I thought Cloudflare would take care of it all!

ivan@BB8:~$ time curl -s http://ivanfhagar.com > /dev/null

real    0m0.723s
user    0m0.000s
sys     0m0.016s
ivan@BB8:~$ time curl -s http://ivanfhagar.com > /dev/null

real    0m0.749s
user    0m0.016s
sys     0m0.000s
ivan@BB8:~$ time curl -s http://ivanfhagar.com > /dev/null

real    0m0.739s
user    0m0.000s
sys     0m0.016s
ivan@BB8:~$ time curl -s http://ivanfhagar.com > /dev/null

real    0m0.739s
user    0m0.000s
sys     0m0.016s
ivan@BB8:~$

I also turned on Jetpack’s image caching. It’s a little bit of a mess, I know, but I’ll be streamlining the whole caching during these days; at least it’s a bit quicker to respond now.


#8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.