May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

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

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

Note: This post assumes you are running Apache on a Linux server, are familiar with the command line, and have root access to the server.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>