0

I'm runnning Directadmin with apache2 and MariaDB server. But I'm having a hard time to understand why my server's CPU usage is so high.

htop screenshot

When I try to look what is happening with strace, for some reason it is stuck on read(7,.

[root@s1 my.cnf.d]# strace -p 6780
strace: Process 6780 attached
read(7,

But when I try to see what files are open (with htop by pressing l), they are constantly changing. Problem started few days ago, average request count per second did not change. I'm trying lots of various methods to check the problem, but can't find any solution.

Apache server-info:

Current Time: Sunday, 22-Dec-2019 21:15:57 EET
Restart Time: Sunday, 22-Dec-2019 20:43:12 EET
Parent Server Config. Generation: 1
Parent Server MPM Generation: 0
Server uptime: 32 minutes 44 seconds
Server load: 22.42 16.36 10.82
Total accesses: 25799 - Total Traffic: 148.9 MB - Total Duration: 22078672311849
CPU Usage: u1358.74 s2198 cu33.49 cs58.63 - 186% CPU load
13.1 requests/sec - 77.7 kB/second - 5.9 kB/request - 855796000 ms/request
36 requests currently being processed, 92 idle workers

KR_W_LRLC____WR_R_L__R___R_RLL___L__LL_RL_R___L__L______LRLW_R_L
________L__________R____________________R____L_____L____R_______

top:

top - 21:22:43 up 26 days,  5:52,  1 user,  load average: 17.54, 16.13, 12.58
Tasks: 391 total,   3 running, 388 sleeping,   0 stopped,   0 zombie
%Cpu(s): 49.9 us, 49.6 sy,  0.0 ni,  0.3 id,  0.0 wa,  0.0 hi,  0.2 si,  0.0 st
KiB Mem : 32605832 total,   218292 free,  2629852 used, 29757688 buff/cache
KiB Swap: 16383996 total, 11705240 free,  4678756 used. 29463816 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 6780 apache    20   0 3738384 275780   5580 S 250.0  0.8  63:01.83 httpd
 6184 mysql     20   0 9831040 514744   6560 S  61.9  1.6  31:56.88 mysqld
 6947 apache    20   0 3602964 189968   4740 S  43.7  0.6  12:10.16 httpd
   46 root      20   0       0      0      0 S   9.9  0.0 428:13.94 kswapd0
 6257 dh00001   20   0  882312 197940  20488 S   3.6  0.6   0:57.29 php-fpm71
18045 admin     20   0  414864  26080  16620 S   3.3  0.1   0:01.30 php-fpm56
 7697 admin     20   0  415160  27148  17944 S   3.0  0.1   0:08.30 php-fpm56
 7707 admin     20   0  417504  28980  19428 S   3.0  0.1   0:08.89 php-fpm56
 7715 admin     20   0  417912  41828  31608 S   3.0  0.1   0:06.76 php-fpm56
15535 admin     20   0  415520  40260  30392 S   3.0  0.1   0:04.53 php-fpm56
15545 admin     20   0  415116  39756  30124 S   3.0  0.1   0:03.96 php-fpm56
 7672 admin     20   0  414948  40748  31456 S   2.6  0.1   0:08.54 php-fpm56
...

Thank you in advance.

6
  • What is Directadmin?
    – Rick James
    Dec 22, 2019 at 20:04
  • A web control panel ran on CentOS 7.
    – N. G.
    Dec 22, 2019 at 20:10
  • Clearly Apache is very busy, but I don't know how to debug that.
    – Rick James
    Dec 22, 2019 at 20:59
  • This URL may be enough for you to identify and correct the problem. bobcares.com/blog/apache-high-cpu-usage - if not, use of their services should get you out of the woods. Dec 23, 2019 at 15:15
  • Additional information request. # cores, any SSD/NVME devices on MySQL Host server? Post on pastebin.com and share the links. From SSH login root, Text results of: B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; E) complete MySQLTuner report 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. Dec 23, 2019 at 15:19

0

You must log in to answer this question.

Browse other questions tagged .