1

I'm having issues with Wordpress being too slow. I discovered it's because of MySQL queries. They take sometimes 2 - 10s - way too long.

I installed Query Monitor to see what's causing the problem: https://cdn.pbrd.co/images/GRit4ZF.png

  • Is this the only "slow" query? Also, check your Plugins. 2 seconds for the options is pretty slow. – kuchenundkakao Oct 30 '17 at 10:56
  • @kuchenundkakao it is not the only slow query. There are others, but it happens only sometimes. – Ondrej Vrabel Oct 30 '17 at 11:32
  • Well, if there are more slow queries, maybe a) the MySQL Server is really really slow, or if the MySQL Server is a different machine than the Webserver, maybe the Connection between MySQL Server and Webserver is really slow. Maybe there is a PHPMyAdmin on the MySQL-Server where you can check if the same query in it is as slow? – kuchenundkakao Oct 30 '17 at 12:08
  • @kuchenundkakao the server is the same. It's running on VPS. – Ondrej Vrabel Oct 30 '17 at 12:17
  • Did you try running the query within PHPMyAdmin? – kuchenundkakao Oct 30 '17 at 12:18
1

WP options (which is one of the most basic and used storage APIs) can be stored with or without "autoload" setting. Usually this is reasonable, since many options will be checked on each and every page load, so loading them in bulk during core load is much more efficient than individually.

Problems usually start when two problems compound:

  1. the total amount of options gets significantly large (let's say hundreds of thousands, but it depends);
  2. large amount and/or size of options are marked for autoload which shouldn't be.

There is no generic solution to this issue, since there is no generic common cause.

You would need to examine your actual data to see which options get loaded and what exactly happens to be a bottleneck.

  • There are 433 rows in SQL. Is it too much? – Ondrej Vrabel Oct 30 '17 at 11:28
  • 2
    Less than a thousand is definitely too few too matter. So it's probably about size of options or possibly something choking in MySQL server itself. – Rarst Oct 30 '17 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.