wp_w3tc_cdn_queue filled up, bad query on non-indexed field
-
For the last two days our site has been running slower and slower, until today it ground to a halt. I traced it to 210,000 rows in wp_w3tc_cdn_queue that were causing the database to run at 100% CPU. All were some variant of
SELECT remote_path from wp_w3tc_cdn_queue where remote_path=<path>;
.- Why are you querying for remote path when you already have the path?
- Why are you doing a full table scan on a non-indexed field?
It appears, based on server performance, that these queries are piggybacked on queries for real data, so when this table exceeded a certain size, it recursively took out legitimate traffic until the whole site timed out. I deleted the table contents, and the site returned.
At the very least, please set an index on remote_path, but I’m still curious why you are making a query for remote_path when you already have the path. It’s like “select id from foo where id=1” – it’s a total waste. This query is on line 640 of
lib/W3/Plugin/Cdn.php.
- The topic ‘wp_w3tc_cdn_queue filled up, bad query on non-indexed field’ is closed to new replies.