# How to prevent nginx locks

**URL:** <https://www.ruby-forum.com/t/how-to-prevent-nginx-locks/221999>\
**Category:** NGINX\
**Created:** [August 8, 2012, 5:36pm UTC](https://www.ruby-forum.com/t/how-to-prevent-nginx-locks/221999 "2012-08-08T17:36:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [August 8, 2012, 5:36pm UTC](https://www.ruby-forum.com/t/how-to-prevent-nginx-locks/221999/1 "2012-08-08T17:36:30Z")

</div>

Hello all,

I have a situation with nginx where occasionally all my worker process  
hang (a ps -awx returns D state) which means that my webserver becomes  
irresponsive.  
I have to add that the lock occurs when trying to serve some files from  
a OCFS2 file system and the only way to solve this is to reboot our  
fileserver.

Obviously I can see that the main problem lies in OCFS2 and not nginx,  
however what I would like do is to prevent nginx from blocking.  
Is there anything I can do in order to have nginx unlock after some  
timeout or something like that? I’ve already looked at all the  
documentation but found nothing. I also increased the worker processes  
to 7 (I have 6 CPU) but all processes simply locks and increasing that  
number is not the solution.

By the way this same situation (nginx blocking) also occurred in the  
past with some SolR http requests we did in our code.

Thanks in advance.

Adelino

Posted at Nginx Forum:

> **[How to prevent nginx locks](https://forum.nginx.org/read.php?2,229461,229461#msg-229461)**
>
> Hello all, I have a situation with nginx where occasionally all my worker process hang (a ps -awx returns D state) which means that my webserver becomes irresponsive. I have to add that the lock occurs when trying to serve some files from a OCFS2...
