Aleksei Chernenkov
Aleksei Chernenkov

Reputation: 1051

Unicorn workers spawns too many threads (mem leaks)

I have running RoR site which handled by unicorn. Unicorn master process spawns 10 workers and handle them well, but workers sometimes starts to spawn threads inside and do not kill them.... it leads to memory leaks and server fault.

I solved it by cron script which restarts unicorn every 10 minutes, but its really bad solution. Any ideas?

ScreenProof: Workers memory leaks

Unicorn (4.6.1) configuration files: https://gist.github.com/907th/4995323

Upvotes: 0

Views: 415

Answers (1)

Richard Brown
Richard Brown

Reputation: 11436

Look into using Monit (http://mmonit.com/monit/) to monitor Unicorn and keep it in check. Watch Ryan Bates' wonderful video on the subject:* http://railscasts.com/episodes/375-monit

*requires a subscription but it's well worth the paltry $9 he's asking.

Upvotes: 1

Related Questions