Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Apache Error: “semget: No space left on device”  (Read 2204 times)

0 Members and 1 Guest are viewing this topic.

sajugovind

  • Guest
Apache Error: “semget: No space left on device”
« on: December 02, 2013, 08:53:11 am »
Apache Error: “semget: No space left on device”


If Apache fails, and will not successfully start again, check the error log. If you see an error similar to the following, it could 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 as root and run the following:

ipcs -s

In order to get Apache started again, we must clear the semaphores. Run this for-loop to flush them:

for whatever in `ipcs -s | awk '{print $2}'`; do ipcrm -s $whatever; done

On older servers that command may not work. In these cases, you may need to do the following:

/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 server. You can do that by adding the following to the /etc/sysctl.conf file:

# Increases the semaphore limits & extend Apache's uptime.
kernel.msgmni = 512
kernel.sem = 250 128000 32 512

Then load the new settings into the kernel:

sysctl -p


Saju Govind
System Engineer Trainee
Admin-Ahead Server Technologies
https://www.admin-ahead.com