To be clear, the issue I have is on a dedicated server. My websites use highly advanced spectra based webpages with many features. My problems arrive when I clear the cache on my website. Usually right after saving a post. This crashes my dedicated website, as the new cache forms. I have definitely tracked this back to over-usage of the database, and I have 100-200 calls to the database when refreshing the page cache. This takes 2-4 seconds for a page to load. If there are bots on my website, this compounds until the database can’t handle the load. I then see 500 errors.
I’ve done extensive troubleshooting on this. I’ve disabled all custom code, but spectra, and the situation continues. I have many, highly configured web pages with many spectra blocks on each one.
I’ve optimized the tables for WordPress, but haven’t touched the plugin ones. The errors I receive are across the board slow queries, until the stack is overcome, and the database catches up. The one query I provided isn’t the only duplicate queries happening, just one of them.
I’m also seeing a situation where WP_Options Transiants are deleted then add again, instead of updated. This causes a table wide indexing, rather than a row specific indexing.
WP Rocket also plays a role in this, as their Pre-Loading and Critical CSS pages cause a large number of pages to start rendering in response to a cache clear. I’ve also had Alexa bots crash the website after a cache clear.