Bobcares

semget: No space left on device – How to resolve this Apache error

by | May 11, 2021

Often users notice that the Apache service fails in the Linux server with the error “semget: No space left on device”.

As a part of our Server Management Services, we help our customers with requests related to Apache regularly.

Let us today discuss the possible reasons and fixes for this error.


 

What is “semget: No space left on device” error

Recently, we received a support request where Apache fails and is not starting again. Our Support Engineers immediately checked the “/usr/local/apache/error_log“. They then found the error as given below:

semget no space left on device

This error generally indicates that the server has run out of semaphores and apache cannot be started.

To see how many semaphores are being used, access the server via SSH as root and run the following command:

# ipcs -s

 

How to fix “semget: No space left on device” error

For the Apache to get 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, this command may not work. In these cases, we 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 recurrent problem for us, we have to increase the semaphore limits on the server. We 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

 
[Need any further assistance to fix Apache errors? – We’re available 24*7]

Conclusion

In short, the semget error can trigger when the server has run out of semaphores. Today, we saw how our Support Engineers fix this error.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

SEE SERVER ADMIN PLANS

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.