How to increase number of semaphore ?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to increase number of semaphore ?

Zoong PHAM
I can not start another (5th) instances of Apache.
Below is the error message from /var/www/logs/error_log:

[Thu Dec  1 01:51:19 2005] [error] mod_ssl: Parent process could not
create private SSLMutex semaphore (System error follows)
[Thu Dec  1 01:51:19 2005] [error] System: No space left on device
(errno: 28)

I tried to stop all the instances of Apache and ipcs reported no
left-over semaphores .
Then I can start only 4 instances. The 5th one always gives the above
error message.

How can I fix that?

Thanks,
Zoong

Reply | Threaded
Open this post in threaded view
|

Re: How to increase number of semaphore ?

Sean Comeau-2
On Thu, Dec 01, 2005 at 02:02:13AM +1100, Zoong PHAM wrote:
> I tried to stop all the instances of Apache and ipcs reported no
> left-over semaphores .
> Then I can start only 4 instances. The 5th one always gives the above
> error message.
>
> How can I fix that?
>

Come on.. Google!

test:~# sysctl kern.seminfo
kern.seminfo.semmni=10       # max number of semaphore identifiers (i.e., sets)
kern.seminfo.semmns=60       # max number of semaphores system-wide
kern.seminfo.semmnu=30       # i'm not sure...
kern.seminfo.semmsl=60       # maximum number of semaphores per set
kern.seminfo.semopm=100      # not sure
kern.seminfo.semume=10       # never changed this one myself
kern.seminfo.semusz=100      # or this
kern.seminfo.semvmx=32767    # max value of semaphore, looks good probably
kern.seminfo.semaem=16384    # no idea

test:~# sysctl kern.shminfo
kern.shminfo.shmmax=33554432 # max size of shared memory segment (bytes)
kern.shminfo.shmmin=1        # min size of shared memory segment (bytes)
kern.shminfo.shmmni=128      # max number of shared memory segments system-wide
kern.shminfo.shmseg=128      # max number of shared memory segments per proc
kern.shminfo.shmall=8192     # total amount of shared memory available (pages)

OK, I assume you know how to use /etc/sysctl.conf to increase these values

Reply | Threaded
Open this post in threaded view
|

Re: How to increase number of semaphore ?

Zoong PHAM
Hi Sean,

On Wednesday, 30 November 2005 at  7:34:59 -0800, Sean Comeau wrote:
> > How can I fix that?

My real question is "if I increased the number of semaphore, would it
fix the problem ?"
Remember the error message I have is:
[Thu Dec  1 01:51:19 2005] [error] mod_ssl: Parent process could not
create private SSLMutex semaphore (System error follows)
[Thu Dec  1 01:51:19 2005] [error] System: No space left on device
(errno: 28)

If the fix is "increase number of metaphores", then which parameters
below can I increase?


> test:~# sysctl kern.seminfo
> kern.seminfo.semmni=10       # max number of semaphore identifiers (i.e., sets)
> kern.seminfo.semmns=60       # max number of semaphores system-wide
> kern.seminfo.semmnu=30       # i'm not sure...
> kern.seminfo.semmsl=60       # maximum number of semaphores per set
> kern.seminfo.semopm=100      # not sure
> kern.seminfo.semume=10       # never changed this one myself
> kern.seminfo.semusz=100      # or this
> kern.seminfo.semvmx=32767    # max value of semaphore, looks good probably
> kern.seminfo.semaem=16384    # no idea
>
> test:~# sysctl kern.shminfo
> kern.shminfo.shmmax=33554432 # max size of shared memory segment (bytes)
> kern.shminfo.shmmin=1        # min size of shared memory segment (bytes)
> kern.shminfo.shmmni=128      # max number of shared memory segments system-wide
> kern.shminfo.shmseg=128      # max number of shared memory segments per proc
> kern.shminfo.shmall=8192     # total amount of shared memory available (pages)
>
> OK, I assume you know how to use /etc/sysctl.conf to increase these values

I know how to use sysctl(8).

Thanks,
Zoong

Reply | Threaded
Open this post in threaded view
|

Re: How to increase number of semaphore ?

Otto Moerbeek
On Thu, 1 Dec 2005, Zoong PHAM wrote:

> Hi Sean,
>
> On Wednesday, 30 November 2005 at  7:34:59 -0800, Sean Comeau wrote:
> > > How can I fix that?
>
> My real question is "if I increased the number of semaphore, would it
> fix the problem ?"
> Remember the error message I have is:
> [Thu Dec  1 01:51:19 2005] [error] mod_ssl: Parent process could not
> create private SSLMutex semaphore (System error follows)
> [Thu Dec  1 01:51:19 2005] [error] System: No space left on device
> (errno: 28)
>
> If the fix is "increase number of metaphores", then which parameters
> below can I increase?

"Educated" guess:

intro(2): errno 28 == ENOSPC
semop(2): [ENOSPC]      SEM_UNDO was requested, and there is not enough space
                        left in the kernel to store the undo information.
sysctl(3): KERN_SEMINFO_SEMMNU is used to set max number of undo structures.

So you should try kern.seminfo.semmnu.

        -Otto

                   

>
>
> > test:~# sysctl kern.seminfo
> > kern.seminfo.semmni=10       # max number of semaphore identifiers (i.e., sets)
> > kern.seminfo.semmns=60       # max number of semaphores system-wide
> > kern.seminfo.semmnu=30       # i'm not sure...
> > kern.seminfo.semmsl=60       # maximum number of semaphores per set
> > kern.seminfo.semopm=100      # not sure
> > kern.seminfo.semume=10       # never changed this one myself
> > kern.seminfo.semusz=100      # or this
> > kern.seminfo.semvmx=32767    # max value of semaphore, looks good probably
> > kern.seminfo.semaem=16384    # no idea
> >
> > test:~# sysctl kern.shminfo
> > kern.shminfo.shmmax=33554432 # max size of shared memory segment (bytes)
> > kern.shminfo.shmmin=1        # min size of shared memory segment (bytes)
> > kern.shminfo.shmmni=128      # max number of shared memory segments system-wide
> > kern.shminfo.shmseg=128      # max number of shared memory segments per proc
> > kern.shminfo.shmall=8192     # total amount of shared memory available (pages)
> >
> > OK, I assume you know how to use /etc/sysctl.conf to increase these values
>
> I know how to use sysctl(8).
>
> Thanks,
> Zoong

Reply | Threaded
Open this post in threaded view
|

Re: How to increase number of semaphore ?

Otto Moerbeek
On Wed, 30 Nov 2005, Otto Moerbeek wrote:

>
> On Thu, 1 Dec 2005, Zoong PHAM wrote:
>
> > Hi Sean,
> >
> > On Wednesday, 30 November 2005 at  7:34:59 -0800, Sean Comeau wrote:
> > > > How can I fix that?
> >
> > My real question is "if I increased the number of semaphore, would it
> > fix the problem ?"
> > Remember the error message I have is:
> > [Thu Dec  1 01:51:19 2005] [error] mod_ssl: Parent process could not
> > create private SSLMutex semaphore (System error follows)
> > [Thu Dec  1 01:51:19 2005] [error] System: No space left on device
> > (errno: 28)
> >
> > If the fix is "increase number of metaphores", then which parameters
> > below can I increase?
>
> "Educated" guess:
>
> intro(2): errno 28 == ENOSPC
> semop(2): [ENOSPC]      SEM_UNDO was requested, and there is not enough space
>                         left in the kernel to store the undo information.
> sysctl(3): KERN_SEMINFO_SEMMNU is used to set max number of undo structures.
>
> So you should try kern.seminfo.semmnu.

Sorry, hit send too early.

From semget(2):
     [ENOSPC]      A new set of semaphores could not be created because the
                   system limit for the number of semaphores or the number of
                   semaphore sets has been reached.

So first try semmni, semmns and semmsl.

                -Otto

> >
> >
> > > test:~# sysctl kern.seminfo
> > > kern.seminfo.semmni=10       # max number of semaphore identifiers (i.e., sets)
> > > kern.seminfo.semmns=60       # max number of semaphores system-wide
> > > kern.seminfo.semmnu=30       # i'm not sure...
> > > kern.seminfo.semmsl=60       # maximum number of semaphores per set
> > > kern.seminfo.semopm=100      # not sure
> > > kern.seminfo.semume=10       # never changed this one myself
> > > kern.seminfo.semusz=100      # or this
> > > kern.seminfo.semvmx=32767    # max value of semaphore, looks good probably
> > > kern.seminfo.semaem=16384    # no idea
> > >
> > > test:~# sysctl kern.shminfo
> > > kern.shminfo.shmmax=33554432 # max size of shared memory segment (bytes)
> > > kern.shminfo.shmmin=1        # min size of shared memory segment (bytes)
> > > kern.shminfo.shmmni=128      # max number of shared memory segments system-wide
> > > kern.shminfo.shmseg=128      # max number of shared memory segments per proc
> > > kern.shminfo.shmall=8192     # total amount of shared memory available (pages)
> > >
> > > OK, I assume you know how to use /etc/sysctl.conf to increase these values
> >
> > I know how to use sysctl(8).
> >
> > Thanks,
> > Zoong

Reply | Threaded
Open this post in threaded view
|

Re: How to increase number of semaphore ?

Zoong PHAM
On Wednesday, 30 November 2005 at 17:07:51 +0100, Otto Moerbeek wrote:
>
> So first try semmni, semmns and semmsl.

Bingo! I tried with the first one and it seems to work (the 5th instance
of Apache started OK).

Here is what I did
# ipcs -T  | grep semmni
        semmni:     10  (# of semaphore identifiers)
# sysctl -w kern.seminfo.semmni=20
kern.seminfo.semmni: 10 -> 20
# ipcs -T  | grep semmni
        semmni:     20  (# of semaphore identifiers)

I will have look further see if there are any other dependent
parameters or the value that I just set is right.

Thanks a lot, guys.

Zoong