Apache High CPU Usage 100%

ssgill

Verified User
Joined
May 9, 2012
Messages
168
Hello, seeing spikes in Apache latest version was happening before update as well cpu running at 100% or over. Only error that i found in logs

[Wed May 10 14:51:53.737447 2023] [http2:error] [pid 28851:tid 140058497619712] (103)Software caused connection abort: [client 52.74.XX.XXX:12234] AH02938: h2_stream(28851-1470-25,HALF_CLOSED_REMOTE): data_cb, reading data

Any help would be apprecited.

Thanks
 
Most of the time I have found this to be caused by Apache waiting for processes and all the connections getting used up, and you see slow website performance or connection issues. Can be caused my many factors, often from low ram, mysql performance issues (needs optimization), too slow cpu, slow storage system... How much memory does the server have? Is there any swap in use? (<-Usually an indication you need more ram.)

With the latest updates I see no performance issues on any of the servers I manage.
 
Thanks cjd, for your response. I kind of tracked it back to apache graceful restart called during nightly tally. I tried replicating it by running

apachectl graceful restart

After this httpd runs at 100% or over CPU

Debian Buster, directadmin all latest

Memory 15GB


Anyone else having similar issue, or where i should be looking for solution. For now contemplating to disable graceful restart.

Thanks
 
Last edited:
Quick update, after disabling graceful restart from directadmin config httpd is working as expected. I did got apache process cpu utilization from server logs after graceful restart was called during nightly telly.


--------------- 5/17/2023, 1:49 AM ------------------
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
24902 apache 20 0 5382728 154068 11920 S 115.2 0.9 73:52.25 /usr/sbin/httpd -DFOREGROUND
30336 madmin 20 0 240892 36936 17472 R 100.0 0.2 0:47.33 php-fpm: pool madmin
1922 apache 20 0 5417864 85956 10532 S 100.0 0.5 223:00.62 /usr/sbin/httpd -DFOREGROUND
30334 madmin 20 0 240892 36120 17468 R 100.0 0.2 0:19.98 php-fpm: pool madmin
1854 apache 20 0 5409192 45728 10572 S 87.9 0.3 467:59.76 /usr/sbin/httpd -DFOREGROUND
30284 madmin 20 0 240892 37584 18104 R 84.8 0.2 1:08.58 php-fpm: pool madmin
24987 apache 20 0 5384096 202464 11856 S 81.8 1.2 26:03.62 /usr/sbin/httpd -DFOREGROUND
30335 madmin 20 0 240828 34592 16000 R 69.7 0.2 0:06.89 php-fpm: pool madmin

---------------- 5/17/2023, 3:22 AM -------------------

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1922 apache 20 0 5417864 51112 10344 S 108.7 0.3 310:51.69 /usr/sbin/httpd -DFOREGROUND
1495 root 20 0 56104 50292 2432 R 100.0 0.3 0:27.12 /usr/bin/lsof -wnlP +c 0
1854 apache 20 0 5409192 44296 10368 S 104.3 0.3 555:52.74 /usr/sbin/httpd -DFOREGROUND
24902 apache 20 0 5382820 167952 11344 S 104.3 1.0 163:37.80 /usr/sbin/httpd -DFOREGROUND
24987 apache 20 0 5384172 233992 11616 S 104.3 1.4 120:47.09 /usr/sbin/httpd -DFOREGROUND

---------------- 5/17/2023, 6:06 AM -------------------

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
24987 apache 20 0 5457936 248772 11652 S 175.9 1.5 361:26.54 /usr/sbin/httpd -DFOREGROUND
24902 apache 20 0 5383016 174852 11428 S 103.4 1.1 327:17.83 /usr/sbin/httpd -DFOREGROUND
1854 apache 20 0 5409192 44296 10368 S 100.0 0.3 715:29.64 /usr/sbin/httpd -DFOREGROUND
1922 apache 20 0 5417864 51112 10344 S 96.6 0.3 470:20.53 /usr/sbin/httpd -DFOREGROUND
24198 madmin 20 0 246116 42508 17732 R 65.5 0.3 1:01.88 php-fpm: pool madmin

-------------- 5/17/2023, 8:48 AM ----------------

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
24987 apache 20 0 5605600 247676 11044 S 266.7 1.5 661:38.34 /usr/sbin/httpd -DFOREGROUND
30146 madmin 39 19 427020 123964 2112 S 212.5 0.8 85:39.23 /usr/local/bin/zstdmt --rsyncable
24902 apache 20 0 5383088 172456 10892 S 133.3 1.1 473:02.48 /usr/sbin/httpd -DFOREGROUND
1854 apache 20 0 5409192 11644 10172 S 112.5 0.1 859:16.40 /usr/sbin/httpd -DFOREGROUND
1922 apache 20 0 5417864 25520 10084 S 108.3 0.2 614:17.13 /usr/sbin/httpd -DFOREGROUND

I had to restart httpd to get it back to normal. Any suggestions would be appreciated, for now apache graceful restart is disabled.

Thanks
 
Back
Top