Unicorn: Which number of worker processes to use?

Posted by blackbird07 on Stack Overflow See other posts from Stack Overflow or by blackbird07
Published on 2012-06-15T18:35:21Z Indexed on 2012/06/17 9:16 UTC
Read the original article Hit count: 258

I am running a Ruby on Rails app on a virtual Linux server that is capped at 1GB RAM. Currently, I am constantly hitting the limit and would like to optimize memory utilization. One option I am looking at is reducing the number of unicorn workers.

So what is the best way to determine the number of unicorn workers to use?

The current setting is 10 workers, but the maximum number of requests per second I have seen on Google Analytics Real-Time is 3 (only scored once at a peak time; in 99% of the time not going above 1 request per second).

So is it a save assumption that I can - for now - go with 4 workers, leaving room for unexpected amounts of requests? What are the metrics I should have a look at for determining the number of workers and what are the tools I can use for that on my Ubuntu machine?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about Performance