D
D
Deshene2014-01-24 12:40:15
Ruby on Rails
Deshene, 2014-01-24 12:40:15

Why are Unicorn workers hanging?

Some time ago I noticed a strange thing - from time to time the server simply stops processing requests for a while. In top's output, it looks like this:
* ten Unicorn workers doing something, processing something;
* then, it is not clear why, they stop doing something, i.e. all ten workers have the sleeping status;
* seconds ten-fifteen-twenty workers do not work;
* after that, as if on command, they suddenly start working all at once and process requests that have accumulated in the nginx queue.
The setup is as follows:
nginx, unicorn 4.6.2, postgres, redis for sessions and cache. MRI ruby ​​2.0.0p353
At first I thought that it might be in the radish (because if it does not give up the session, then all processes will block in anticipation), but it seems that it is not in it, because. when unicorn hangs, redis normally serves processes that handle background tasks.
I don't understand what could be the issue.
If anyone has any ideas, I'd be happy to check them out. If you need more information - tell me what exactly you need, I will try to provide.
UPDATE:
Thanks fomistoklus , I think I understand what the problem is. I'll test it for a couple of days and post the results.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question