# MySQL Utilizes high CPU all the time

**URL:** <https://forums.percona.com/t/mysql-utilizes-high-cpu-all-the-time/6673>\
**Category:** Other MySQL® Questions\
**Created:** [November 8, 2018, 5:54am UTC](https://forums.percona.com/t/mysql-utilizes-high-cpu-all-the-time/6673 "2018-11-08T05:54:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![farhana](https://avatars.discourse-cdn.com/v4/letter/f/41988e/32.png) [@farhana](https://forums.percona.com/u/farhana)\
**Post date:** [November 8, 2018, 5:54am UTC](https://forums.percona.com/t/mysql-utilizes-high-cpu-all-the-time/6673/1 "2018-11-08T05:54:27Z")

</div>

Hi Team,  
I am running a problem with one of my VM dedicated for mysqld service. All the time the CPU utilization on the system is high and even consuming the swap memory too.I have described the specifications below(let me know if you need any more details). Could anyone of you please analyze and let me know what i am missing here/any changes recommended in configuration.

RAM 251G  
Swap 8G  
20 cores  
Red Hat Enterprise Linux Server release 7.2  
5.7.17-enterprise-commercial-advanced-log

# my.cnf

[mysqld]  
port=9000  
pid-file=/var/run/mysqld/mysqld.pid  
socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

server-id=1  
datadir=/datasas/mysql\_new/datadir  
tmpdir=/datasas/mysql\_new/mysqltemp  
binlog\_format = statement  
event\_scheduler=on

# LOGS DATA

log\_output = FILE  
log\_warnings=0  
log\_bin = ON  
log-bin=/datassd/mysql/bin\_log/DPDP\_DB\_BINlog  
expire\_logs\_days = 1  
binlog\_format = STATEMENT  
local\_infile = 0  
binlog\_error\_action=‘IGNORE\_ERROR’

# ERROR LOGS

log-error=/datasas/mysql\_new/error\_log/mysql\_error.log

#SLOW QUERY LOGS  
log\_slow\_admin\_statements=1  
log\_queries\_not\_using\_indexes=0  
log\_throttle\_queries\_not\_using\_indexes=3  
slow\_query\_log = 1  
slow\_query\_log\_file = /datasas/mysql\_new/slow\_query\_log/slow\_querry.log  
long\_query\_time = 5  
slow\_launch\_time=2

# MyISAM

key-buffer-size = 5G

# SAFETY

max-allowed-packet = 16M  
max-connect-errors = 1000000  
sql-mode = STRICT\_ALL\_TABLES

# CACHES AND LIMITS

tmp-table-size = 32M  
max-heap-table-size = 32M  
query-cache-type = 0  
query-cache-size = 0  
max-connections = 1800  
thread-cache-size = 256  
open-files-limit = 65535  
table-definition-cache = 10000  
table-open-cache = 10000  
join\_buffer\_size = 4M  
sort\_buffer\_size = 512K  
read\_buffer\_size = 512K

# INNODB

# innodb-flush-method = O\_DIRECT innodb-log-files-in-group = 2 innodb-log-file-size = 512M innodb-flush-log-at-trx-commit = 2 innodb-file-per-table = 1 innodb-buffer-pool-size = 160G innodb\_buffer\_pool\_chunk\_size = 4G innodb\_buffer\_pool\_instances = 40 innodb\_thread\_concurrency = 30

traffic - not more than 1000 connections at peak time.  
Do not find any huge queries running on the host.  
Any suggestions are appreciated most.

Thanks  
Farhana Mohammed
