My server sometimes gets filled up with connections in apache stuck in a "Sending Reply" state, requiring me to restart apache. Most of the time this works, but sometimes I will get this error when trying to restart apache instead:
Job for httpd.service failed because the control process exited with
error code. See "systemctl status httpd.service" and "journalctl -xe"
for details.
Running systemctl status httpd.service
or journalctl -xe
as suggested then brings back the following relevant information:
Nov 15 06:24:06 hostname.biologyreporter.com systemd-logind[874]:
Failed to remove runtime directory /run/user/1067: Device or resource busy
Nov 15 06:24:27 hostname.biologyreporter.com restartsrv_httpd[29484]:
[Fri Nov 15 06:24:27.255594 2019] [core:emerg] [pid 29509:tid 47498001208384]
(28) No space left on device: AH00023: Couldn't create the mpm-accept mutex
Nov 15 06:24:27 hostname.biologyreporter.com restartsrv_httpd[29484]:
(28) No space left on device: could not create accept mutex
Nov 15 06:24:27 hostname.biologyreporter.com restartsrv_httpd[29484]:
AH00015: Unable to open logs
Nov 15 06:24:27 hostname.biologyreporter.com systemd[1]:
httpd.service: control process exited, code=exited status=1
Nov 15 06:24:27 hostname.biologyreporter.com systemd[1]:
Failed to start Apache web server managed by cPanel EasyApache.
-- Subject: Unit httpd.service has failed
It may then take ~10 minutes or so for apache to actually restart and the website to be functional again. I don't know why it is saying "No space left on device" as running df
, for example, returns the following (nowhere is 100% of space taken):
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 3973024 0 3973024 0% /dev
tmpfs 3983400 0 3983400 0% /dev/shm
tmpfs 3983400 255296 3728104 7% /run
tmpfs 3983400 0 3983400 0% /sys/fs/cgroup
/dev/sda2 952008348 137586024 766039760 16% /
/dev/sda1 999320 134892 795616 15% /boot
/dev/loop0 3997376 8856 3778808 1% /tmp
tmpfs 796684 0 796684 0% /run/user/0
tmpfs 796684 0 796684 0% /run/user/1022
I've been unable to find any reliable information on the cause and solution of the specific error(s) as listed above
No space left on device: AH00023: Couldn't create the mpm-accept mutex
andFailed to remove runtime directory /run/user/1067: Device or resource busy
What should I do to solve this so that these errors don't show up and apache always restarts without issues?