LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Useless mutex ? (https://www.linuxquestions.org/questions/linux-server-73/useless-mutex-4175519703/)

Pandamaury 09-22-2014 07:58 AM

Useless mutex ?
 
Hello :D

Last week we tried to restart Apache but we had a bug. Apparently there were too many mutexes in use so it was not able to start.

When I was looking at the existing mutexes I saw that many of them don't seem to be used. The fields ncount and zcount of ipcs -s -i <semid> were both at 0, meaning that nothing is waiting for it or using it (that's what I understood, is it right ?).

When looking for process with the pid indicated in the pid field of ipcs there were 0 returns (ps -ef | grep <pid>).

Does this mean that these mutex are useless ? Are they some kind of zombies ? Can I delete them ?

Thanks in advance :D

smallpond 09-22-2014 08:33 AM

When asking a question about an error, please paste the actual message that you see.

Pandamaury 09-22-2014 10:08 AM

The question is not really about the error but about the possibility of useless mutexes.

I don't have the error anymore but after we deleted some mutexes, Apache was able to start again.

Sorry if it wasn't clear :(

GaWdLy 09-24-2014 02:00 AM

It's more likely to be a tuning or application issue than apache doing something "useless" with the semaphore. The one experience I have with semaphore trouble on an apache box was actually caused by overly slow db queries, and had nothing to do with apache. If the db wasn't choking, the semaphores wouldn't have run out.

Pandamaury 09-24-2014 07:10 AM

Ok.

Does this mean that I can erase these semaphores or is it better to keep them ?[COLOR="Silver"]

GaWdLy 09-24-2014 11:22 PM

Quote:

Originally Posted by Pandamaury (Post 5243454)
Ok.

Does this mean that I can erase these semaphores or is it better to keep them ?[COLOR="Silver"]

You can dump the semaphores using ipcrm, and you can increase the number of semaphores on the system.

Here's a quick article about increasing sems: https://access.redhat.com/solutions/2896

And one about deleting ipcrm: http://stackoverflow.com/questions/2...hores-on-linux

And another: http://serverlinux.blogspot.com/2007...emaphores.html

I remember how crappy this was when it happened to me. We had to invest extensively in revamping our database in order to resolve the issue. Hopefully you don't need to go so far.

Pandamaury 09-25-2014 02:13 AM

Ok, thanks !


All times are GMT -5. The time now is 06:57 PM.