Re: Mysql 8.0: High CPU Usage
I am sharing your suggested information. Infact, we are also using 5.7 on some servers and didn't found same issue but in 8.0 we are facing the same issue.
top command (OS)
=================
Tasks: 203 total, 2 running, 201 sleeping, 0 stopped, 0 zombie
%Cpu0 : 72.9 us, 1.7 sy, 0.0 ni, 24.0 id, 0.7 wa, 0.0 hi, 0.7 si, 0.0 st
%Cpu1 : 61.0 us, 2.8 sy, 0.0 ni, 35.5 id, 0.3 wa, 0.0 hi, 0.3 si, 0.0 st
%Cpu2 : 64.6 us, 1.7 sy, 0.0 ni, 32.6 id, 1.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu3 : 76.7 us, 2.4 sy, 0.0 ni, 20.1 id, 0.7 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu4 : 65.2 us, 1.4 sy, 0.0 ni, 31.4 id, 1.7 wa, 0.0 hi, 0.3 si, 0.0 st
%Cpu5 : 71.1 us, 1.7 sy, 0.0 ni, 26.1 id, 1.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu6 : 73.4 us, 2.4 sy, 0.0 ni, 23.5 id, 0.7 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu7 : 68.5 us, 1.4 sy, 0.0 ni, 28.7 id, 1.4 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu8 : 68.2 us, 1.4 sy, 0.0 ni, 29.1 id, 1.0 wa, 0.0 hi, 0.3 si, 0.0 st
%Cpu9 : 72.3 us, 1.7 sy, 0.0 ni, 24.9 id, 0.7 wa, 0.0 hi, 0.3 si, 0.0 st
%Cpu10 : 75.5 us, 1.0 sy, 0.0 ni, 22.4 id, 1.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu11 : 67.7 us, 2.1 sy, 0.0 ni, 29.2 id, 1.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 24515472 total, 204608 free, 22918172 used, 1392692 buff/cache
KiB Swap: 20643836 total, 18542072 free, 2101764 used. 914164 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
462 mysql 20 0 31.2g 21.4g 11468 S 854.3 91.5 22455:56 mysqld
495 root 0 -20 0 0 0 S 1.0 0.0 44:05.08 kworker/0:1H
9 root 20 0 0 0 0 R 0.3 0.0 20:14.66 rcu_sched
333 nrpe 20 0 44880 1600 1292 S 0.3 0.0 0:00.01 nrpe
564 root 20 0 157844 106024 105880 S 0.3 0.4 10:00.51 systemd-journal
740 root 20 0 0 0 0 S 0.3 0.0 0:16.90 hv_balloon
Show processlist (MYSQL) is showing 15 active commands but too many reading requests which entertain less than 3 secs.
SHOW VARIABLES LIKE '%threads%'
=================================
"innodb_parallel_read_threads" "4"
"innodb_purge_threads" "4"
"innodb_read_io_threads" "4"
"innodb_write_io_threads" "4"
"max_delayed_threads" "20"
"max_insert_delayed_threads" "20"
"myisam_repair_threads" "1"
"mysqlx_min_worker_threads" "2"