semget: No space left on device

Dualdot

Verified User
Joined
Dec 28, 2005
Messages
8
Hi,

Today Apache went down with the following error: semget: No space left on device. This is the second time in 5 weeks or so that this happened. Restarting apache won't do anything, I had to kill orphaned semaphores.

In case anyone else has this problem and searches the forum for it, the solution is:
ipcs -s | grep apache | perl -e 'while (<STDIN>) { @a=split(/\s+/); print `ipcrm -s $a[1]`}'

Well I Googled for the how and why of this error, and it seems to be all about ssl, and config errors:

"Perhaps this is already known, but there's a semaphore leak when httpd is started with SSL and the startup process is aborted because of a config problem. The process ends but the allocated semaphore is never
freed which, after repeated attempts, can lead to this: semget: No space left on device"

I am just using the apache config DirectAdmin creates, nothing weird is done by me, so is there an error in DA? Did anyone else have this problem?

I am running Apache Apache 1.3.34 on CentOS 4.3.
 
I've never had the problem with many similarly configured servers.

Since you write the problem occurs when the httpd startup process is aborted, I suggest you check your server-level httpd error log, which is where you'll find any httpd startup errors.

Jeff
 
Just had this same problem. Semget errors? WTF??

Anyway, the fix provided by dualdot

PHP:
ipcs -s | grep apache | perl -e 'while (<STDIN> ) { @a=split(/\s+/); print `ipcrm -s $a[1]`}'

worked like a champ.

Thanks dualdot.
 
We had the same problem occur last night with 1.3.37. We haven't seen the problem in a while, though, so perhaps it's occurring less often.

Anyone have any ideas on how to test for it? We can write a script.

Jeff
 
The core problem is mod_throttle, which is not maintained for years in the meantime.

Simply disable it and you will get rid of the semaphore problem.
 
We don't include mod_thottle by default. There are <IfDefine HAVE_THROTTLE> options in your httpd.conf though, but they're not "true" if /usr/lib/apache/mod_thottle.so doesn't exist... which it shouldnt with the default install.

John
 
That's what I thought looking at code on our systems in which we've seen the semget problem. Thanks for clarifying it for us.

Jeff
 
Hi all,

I know this is an very old thread but sinds we are facing this issue at the moment with one of or server i have checked for mod throttle thats not in the httpd.conf nor is it in additional conf files.
We run cb 2 latest version 1.44.3 with apache 2.4.2.

http://help.directadmin.com/item.php?id=110 indeed fixes the issue and apache can start again but how come it occurs ? can it come due to lack of performace of the server itself ?

Any idea ??
 
Back
Top