1

Box is running only mysql and CPU is at 400% constantly. I can't seem to find anything that would be causing it. I've changed a few values in my.cnf based on some research, but had no luck reducing the CPU usage.

my.cnf as follows:

[mysqld]
basedir=/opt/bitnami/mysql
datadir="/opt/bitnami/mysql/data"
port=3306
socket=/opt/bitnami/mysql/tmp/mysql.sock
tmpdir=/opt/bitnami/mysql/tmp
#bind-address=127.0.0.1
skip-name-resolve=1
skip-external-locking
key_buffer_size = 64M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 64M
thread_cache_size = 40
join_buffer_size = 1M
query_cache_limit=0
innodb_lru_scan_depth=100
max_connections = 100
open_files_limit=30000
# Try number of CPU's x 2 for thread_concurrency
thread_concurrency = 16
1

1 Answer 1

0

Remove these for a start, they are almost certainly counterproductive:

table_open_cache = 256
join_buffer_size = 1M
thread_concurrency = 16

There is also a conspicuous absence of innodb_buffer_pool_size being set.

Configuration isn't going to be the root cause of your problem, though - you need to identify what queries are eating all of your CPU and address those specifically, either by rewriting them or by making sure that appropriate indexes for them exist.

3
  • 1
    @GeorgeMcCann Additional information request. Any SSD or NVME devices on MySQL Host server? Post on pastebin.com and share the links. From your SSH login root, Text results of: B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; AND Optional very helpful information, if available includes - htop OR top for most active apps, ulimit -a for a Linux/Unix list of limits, iostat -xm 5 3 for IOPS by device and core/cpu count, for server workload tuning analysis to provide suggestions. Jun 3, 2020 at 15:32
  • As for the absence of the buffer_pool_size, I have found (so far) that cloud services do a pretty good job of setting that.
    – Rick James
    Jun 7, 2020 at 21:23
  • @RickJames the only indication we have here is that it is an EC2 instance, not RDS. Jun 7, 2020 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.