mysql – high CPU – mysqltuner support (wordpress)

I just migrated a wordpress blog on a new server. He has about 120,000 messages.

The problem is that it is hit, hangs or even hangs when using mysql.
One word post operation (without plug-in) create post consumes 60 to 80% of the CPU. And when to perform 3-5 database operation it will freeze
And there is no log for a slow query.

System: Ubuntu 18.04 with 16 GB of RAM, 8 Core processors, 120 GB of disk and MySQL version 5.7.25

Here is mysqltuner and other reports

and mysql.cnf current

[mysqld]



# Ignore reverse DNS lookup of clients
skip-name-resol

default-storage-engine = InnoDB

max_allowed_packet = 500M
max_connections = 256
# wait_timeout = 60
innodb_file_per_table = 1
innodb_buffer_pool_size = 4G
innodb_buffer_pool_instances = 4
innodb_log_file_size = 512M
innodb_flush_log_at_trx_commit = 1
innodb_flush_method = O_DIRECT
innodb_open_files = 5000
innodb_io_capacity = 2000
innodb_io_capacity_max = 4000
innodb_old_blocks_time = 2000
open_files_limit = 50000

query_cache_type = 1
query_cache_min_res_unit = 1M
query_cache_limit = 8M
query_cache_size = 512M

tmp_table_size = 256M
max_heap_table_size = 256M

#key_buffer_size = 128M
thread_stack = 128K
thread_cache_size = 32

slow-query-log = 1
slow-query-log-file = /var/lib/mysql/mysql-slow.log
long_query_time = 1