2

Our new VPS server for a wordpress website, have high CPU usage for mysql process, 50% CPU usage all the time. We don't have that many visitors and killing the process not working, there another new mysql process with hugh cpu usage.

The process:

43361 (Trace) (Kill)    mysql   0     49.49   3.38  /usr/sbin/mariadbd

The trace:

strace: Process 43361 attached
restart_syscall(<... resuming interrupted poll ...>) = 1
accept4(25, {sa_family=AF_UNIX}, [128 => 2], SOCK_CLOEXEC) = 69
futex(0x55f1f596c328, FUTEX_WAKE_PRIVATE, 1) = 1
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=23, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLIN}], 3, -1) = 1 ([{fd=25, revents=POLLIN}])
accept4(25, {sa_family=AF_UNIX}, [128 => 2], SOCK_CLOEXEC) = 17
futex(0x55f1f596c328, FUTEX_WAKE_PRIVATE, 1) = 1
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=23, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLIN}], 3, -1) = 1 ([{fd=25, revents=POLLIN}])
accept4(25, {sa_family=AF_UNIX}, [128 => 2], SOCK_CLOEXEC) = 76
futex(0x55f1f596c328, FUTEX_WAKE_PRIVATE, 1) = 1
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=23, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLIN}], 3, -1) = 1 ([{fd=25, revents=POLLIN}])
accept4(25, {sa_family=AF_UNIX}, [128 => 2], SOCK_CLOEXEC) = 17
futex(0x55f1f596c32c, FUTEX_WAKE_PRIVATE, 1) = 1
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
accept4(25, 0x7ffef08641a0, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=23, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLIN}], 3, -1) = 1 ([{fd=25, revents=POLLIN}])
accept4(25, {sa_family=AF_UNIX}, [128 => 2], SOCK_CLOEXEC) = 69
futex(0x55f1f596c32c, FUTEX_WAKE_PRIVATE, 1) = 1

...

What can I do to stop this? Please help.

Thanks!

5
  • Additional DB information request, please. OS, Version? RAM size, # cores, any SSD or NVME devices on MySQL Host server? Post TEXT data on justpaste.it and share the links. From your SSH login root, Text results of: A) SELECT COUNT(*) FROM information_schema.tables; B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; E) STATUS; not SHOW STATUS, just STATUS; G) SHOW ENGINE INNODB STATUS; for server workload tuning analysis to provide suggestions. Commented Apr 19 at 21:55
  • Post TEXT data on justpaste.it and share the links. Additional very helpful OS information includes - please, htop 1st page, if available, TERMINATE, top -b -n 1 for most active apps, top -b -n 1 -H for details on your mysql threads memory and cpu usage, ulimit -a for list of limits, iostat -xm 5 3 for IOPS by device & core/cpu count, df -h for Used - Free space by device, df -i for inode info by device, free -h for Used - Free Mem: and Swap:, cat /proc/meminfo includes VMallocUused, for server workload tuning analysis to provide suggestions. Commented Apr 19 at 21:56
  • start with SHOW PROCESSLIST;
    – AlexD
    Commented Apr 20 at 6:51
  • Make that SHOW FULL PROCESSLIST; for a more meaningful display of information, logged in as root. Commented Apr 20 at 15:09
  • @Julash Any chance you will have time to post additional information requested on April 19, 2024? Commented May 15 at 22:09

1 Answer 1

1

Please check if your database server is publicly accessible (mysql port 3306). Thus it could could be brute force attack on DB server it self, either also attack on WP website, if you have not disabled user registration and anonymous commenting on posts.

Also depending on VPS provider, you could have hit CPU credit limit, thus your vps is throttled down, effectively indicating high CPU usage.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .