This article covers methods to resolve Apache Error: "semget: No space left on device". This error indicates that apache failed and will not start again, so check the error log If you see an error similar to the following, it could indicate that your server has run out of semaphores and apache cannot be started:
[emerg] (12)Cannot allocate memory: mod_fcgid: Create process manager error
[error] (28)No space left on device: Cannot create SSLMutex Configuration Failed
To solve this problem you can restart Apache, Postgres and other services that consumer many IPC resources or increase limit of the resources in the system using 'sysctl'. When you stop all services the semaphores and shared memory segments have to be removed, if not, and you still able to see them using 'ipcs' command, try to remove them manually using 'ipcrm' command.
1. For example to remove semaphore:
# ipcs -a
2. If this is a common problem for you, you may want to increase the semaphore limits on your VPS 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
3. Then load the new settings into the kernel: