Semaphore Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rushik

    #1

    Semaphore Error

    Hello all,

    I m facing an interesting problem related to semaphore in php.

    We are using a huge business application running on LAMP. For database
    operations we are maintaining centralized DB manager classes in php
    which perform all the single table related activity. Before inserting
    new record we are acquiring semaphore on specific key (all the tables
    are having seprate sem keys), insert the record and release the
    semaphore.
    [color=blue]
    >From past few days we are getting error "Warning: sem_get()[/color]
    [function.sem-get]: failed for key ___: No space left on device", i've
    gone to linux console check thru ipcs command whether semaphore is
    there or not ?? ___ sem was there i've removed that by ipcrm, it
    started working.

    Now the problem is, I m acquiring sem on key say 774, then i m not able
    to use sem keys 775, 776, 777 etc, I really dont know the reason.

    I've made one test page having a loop in which i'd tried to acquire
    semaphore from a certain range starts from 10 to 200, i also display
    the result whether semaphore acquire is succeed or not..?? I've
    executed the script and got the random result. on some keys i've
    succeed and on some i've got problem with the above error message.

    I'm searching the problem on google but i m not getting proper
    solution. Can anyone has faced the same or related problem like this?

    Thanks
    Rushik.

  • Colin McKinnon

    #2
    Re: Semaphore Error

    rushik wrote:
    [color=blue]
    >
    > We are using a huge business application running on LAMP. For database
    > operations we are maintaining centralized DB manager classes in php
    > which perform all the single table related activity. Before inserting
    > new record we are acquiring semaphore on specific key (all the tables
    > are having seprate sem keys), insert the record and release the
    > semaphore.
    >[/color]

    Why? MySQL is quite capable of isolating DML operations.
    [color=blue][color=green]
    >>From past few days we are getting error "Warning: sem_get()[/color]
    > [function.sem-get]: failed for key ___: No space left on device", i've
    > gone to linux console check thru ipcs command whether semaphore is
    > there or not ?? ___ sem was there i've removed that by ipcrm, it
    > started working.
    >[/color]

    (/me does not like IPC)

    How many semaphores have you got in use? It might be useful to include (a
    sample of) the output of ipcs or 'cat /proc/sysvipc/shm'. AIR there are
    hard limits compiled into the kernel.
    [color=blue]
    > Now the problem is, I m acquiring sem on key say 774, then i m not able
    > to use sem keys 775, 776, 777 etc, I really dont know the reason.
    >[/color]

    eh? I've only seen mapping filenames to keys using ftok.

    HTH

    C.

    Comment

    Working...