Slow queries constantly getting stuck on Wordpress database of ~100,000 posts
I am constantly getting stuck SELECT queries on my wordpress databases like the following:
https://i.stack.imgur.com/grZs3.png
Many of the SELECT queries that get stuck are fairly ordinary, such as pulling the last 10 posts of an author or pulling 10 posts in a category - these are normal Wordpress core queries that should run in a split second. My Wordpress databases that get afflicted with this have around 100,000 rows in the wp_posts table, with a size of around 1GB. This is an example of the largest tables from one of the databases: https://i.stack.imgur.com/vXtYy.png
My dedicated server has 4 CPU cores @ 3.4 GHz and 8 GB DDR4 RAM. For this server and these databases, should these kinds of issues be happening? What can I do to make normal Wordpress queries always run without getting stuck? I have tried changing from MyISAM to InnoDB with no effect, as well as changing different settings in my.cnf - here it is currently:
And the result of running
Many of the SELECT queries that get stuck are fairly ordinary, such as pulling the last 10 posts of an author or pulling 10 posts in a category - these are normal Wordpress core queries that should run in a split second. My Wordpress databases that get afflicted with this have around 100,000 rows in the wp_posts table, with a size of around 1GB. This is an example of the largest tables from one of the databases: https://i.stack.imgur.com/vXtYy.png
My dedicated server has 4 CPU cores @ 3.4 GHz and 8 GB DDR4 RAM. For this server and these databases, should these kinds of issues be happening? What can I do to make normal Wordpress queries always run without getting stuck? I have tried changing from MyISAM to InnoDB with no effect, as well as changing different settings in my.cnf - here it is currently:
[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
log-error=/var/lib/mysql/errorlog.err
performance-schema=0
default-storage-engine=MyISAM
max_allowed_packet=268435456
open_files_limit=10000
slow_query_log=ON
log_slow_verbosity=1
innodb_buffer_pool_size=1G
aria_pagecache_buffer_size=512M
query_cache_size=0
query_cache_type=0
query_cache_limit=0
join_buffer_size=512K
tmp_table_size=32M
max_heap_table_size=32M
table_definition_cache=1200
And the result of running
Please sign in to leave a comment.
Comments
0 comments