how to find and correct plugin query performance issues

I have recently uploaded a new site I’ve been working on for a while – which is working and performing very well on the localhost – there is no notable sluggishness to the load-times.

Once uploaded to the server ( dreamhost dreampress WordPress optimized VPS ) – the site is so slow as to be almost unusable – what should I test, how and with what tools?

Read More

While my question may be very specific – I’d like to know about a good general routine for debugging and fixing this type of environmental difference – and include the following data to show people what I’ve looked into so far.

Update — :

The number of requests and cached hits to the database is roughly equal between the local and live site – but the main problem seems to be a very long “waiting” cycle on page loads – between 10 – 20 seconds – but how can I find out what is happening in that time – what is the site waiting for?

Update —- :

Tested page load via pingdom – averaging about 12 – 15 seconds to load
Tested DNS – all 6 tests passed without error
Tested Ping / TraceRoute – all clear

Plugin Data —- :

Here is a pie chart from the godaddy P3 plugin for the localhost plugin resource usage and load time impact:

enter image description here

However, once uploaded ( to dreampress WordPress optimized VPS server ) the site is so sluggish and unresponsive, it’s almost unusable – here is the same data from the live site:

enter image description here

The SabaiDiscuss Wrappers plugin goes form using 4% or resources to over 50% – the number of queries jump from 71 to 159

There are two additional plugin running on the live site – MinQueue to cache and minify scripts / sources and another debugging plugin.

Debug Bar gives me these two sets of data:

Localhost —- :

PHP
5.3.5
MySQL
5.5.8
Memory Usage
35,760,984 bytes

TOTAL QUERIES:
82
TOTAL QUERY TIME:
56.2 ms

Development Server — :

PHP
5.3.27
MySQL
5.0.67
Memory Usage
29,408,256 bytes

TOTAL QUERIES:
88
TOTAL QUERY TIME:
6,497.3 ms

Which seems to show the same number of queries are being run, but taking 1000 times longer to complete.

Related posts

1 comment

  1. There’s an amazing plugin (as usual) called Query Monitor that will give you an amazing set of stats about all the queries run on a page load.

    You can see how many queries are made, by which components, how long they take – pretty much everything. I wouldn’t necessarily run this on a live site very much, depending on your traffic & users. Be sure to read the instructions to be sure it doesn’t output to the public.

    http://wordpress.org/plugins/query-monitor/

Comments are closed.