Apache Error: “semget: No space left on device”

If Apache is down because of some issue, and does not start again,can easily check the error log with in the cPanel. These issues can indicate that your server has run out of semaphores.
——————————–
semget: No space left on device
——————————–

To see how many semaphores are being used, SSH to your server has root and runs on the following:
———
ipcs -s
———

In order to restart the Apache service again, we must clear the semaphores.A user can run it to flush them :
—————————–
for whatever in `ipcs -s | awk ‘{print $2}’`; do ipcrm -s $whatever; done
—————————–

With some of our older servers are too working, there the command may not work. In that stuff, you have to do the following stuff as mentioned below :
——————————————————————–
/sbin/service httpd stop
ipcs -s | grep nobody | gawk ‘{ print $2 }’ | xargs -n 1 ipcrm sem
/sbin/service httpd start
——————————————————————–

If this is a common problem for you, you may want to increase the semaphore limits on your hosting server. You can do that by adding the following to the.
————————-
/etc/sysctl.conf file:
————————-

# For Increases the semaphore limits & extend Apache’s uptime.

————————-
kernel.msgmni = 512
kernel.sem = 250 128000 32 512
————————-

Later on a user can load the new settings into the kernel:
————————-
sysctl -p
————————-
Note: This post assumes that the user is running Apache on a Linux server and is familiar with the command line, and has the root access to the server.