4 ms·
I am glad to see them mentioning this. We use Unicorn, and have for quite a while, as a means of lowering the bottlenecks and slow response times. I strongly su
by scottshea 14y ago
I am glad to see them mentioning this. We use Unicorn, and have for quite a while, as a means of lowering the bottlenecks and slow response times. I strongly suggest looking at Unicorn Worker Killer too (https://github.com/kzk/unicorn-worker-killer https://github.com/kzk/unicorn-worker-killer) given the cap on memory for the dynos
- eminh 14y agoFor those interested in doing monitoring outside of the process itself, we run this command every minute via cron ps -o rss,pid= -U username | sort -k 1 -nr | head -2 | awk -F: '{FS=" ";if ($1>limit*1000) print $2}' limit=`jot -r 1 144 192` | xargs kill -QUIT It will gracefully kill 2 most memory-consuming unicorn workers above random range of 144-192MB of memory. It proved to be extremely efficient and simple solution to our needs.