Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5527

taela87 on "100-150 MySQL Queries per page?"

$
0
0

Hi,

I'm running a site on shared hosting, which I'm thinking of upgrading to VPS, but my host recommends that I fix the speed issues before I decide if I need to upgrade. I have abnormally slow loading times and first byte on the site.

I'm using the latest version of Wordpress and all the plugins are updated. I'm also using CloudFlare to keep the site useable at the moment.

I do use a lot of plugins (56 active ones), but over half of them are meant to speed up the site or make it secure (Zen Cache, TinyPNG, Wordfence etc). They're all recommended plugins with thousands of active users, but it is possible one of them is a problem. Some are quite big plugins (Woocommerce, Paid Memberships Pro and Buddypress).

All my images are optimized, and I've set revisions and thumbnails so Wordpress only creates 1 of each rather than storing them. The site file size is 186MB, and it has about 500 pages, roughly. It could be more with the archives.

The site is a few years old, and it's been through many plugins and themes over the years, so it is likely that the database is in need of some work. I do have WP Optimize, but I don't know if that cleans up the MySQL. If this site is anything to go by, it doesn't.

My hosting is middle of the range shared hosting on a Linux server at the moment. Here are the stats from cPanel:
1GB Physical Memory
10GB Diskspace
4GB Monthly Bandwidth

It's also worth noting that the site has SSL installed. For a while I wondered if it was a redirect loop of some kind with all the HTTPS redirecting, but cleaning up my HTACCESS file didn't solve the problem.

I don't expect miracles from my current setup, but 32s load time indicates there is a problem with how I've setup the site, so I'm trying to work out what I can do to find the problem, and then I can start working on how to resolve it.

Using P3 Plugin Profiler, I've run some diagnostics to see where I should start working on how to fix this, and I guess the question is how do I fix the MySQL queries problem? I suspect that 100+ queries for every page is probably slowing down the plugins too, so I think I need to fix that first, and then diagnose the plugins again to see what their load time really is because I figure if each plugin is loading up 100+ times, the plugin results could be bloated by the MySQL queries.

Here are the P3 results:
All Plugins On
Total Load Time: 34.4279seconds avg.
Site Load Time: 18.9800seconds avg.
Profile Overhead: 15.4478seconds avg.
Plugin Load Time: 17.8301seconds avg.
Theme Load Time: 0.2817seconds avg.
Core Load Time: 0.6271seconds avg.
Margin of Error: 0.2411seconds avg.
(34.4279 observed, 34.1867 expected)
Visits: 18
Number of PHP ticks: 86,403 calls avg.
Memory Usage: 157.46 MB avg.
MySQL Queries: 151 queries avg.

All Plugins Off
Total Load Time: 2.0964seconds avg.
Site Load Time: 1.4357seconds avg.
Profile Overhead: 0.6607seconds avg.
Plugin Load Time: 0.3077seconds avg.
Theme Load Time: 0.4309seconds avg.
Core Load Time: 0.6862seconds avg.
Margin of Error: 0.0109seconds avg.
(2.0964 observed, 2.0855 expected)
Visits: 17
Number of PHP ticks: 298 calls avg.
Memory Usage: 34.74 MB avg.
MySQL Queries: 105 queries avg.

I'd be really grateful for some advice about what to do next. I'm 'guessing' that I need to sort out those SQL queries first, but how do I do that?


Viewing all articles
Browse latest Browse all 5527

Trending Articles