Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8095365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:06:16+00:00 2026-06-05T21:06:16+00:00

I am running a Ruby on Rails app on a virtual Linux server that

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T21:06:18+00:00Added an answer on June 5, 2026 at 9:06 pm

    The amount of workers you should use depends greatly on what your app itself is doing and how ofter it is doing those things. There really isn’t a perfect ratio formula for it unfortunatly that will work in every single test case. This becomes even more true when you take into account the fact that you have a finite amount of RAM that you have to keep your server on.

    Many will suggest that CPU Core Count + 1 but that isn’t correct either. You will have to do test cases with different amounts of workers present and see how things go. Be sure to check the logs regularly.

    In our team we use a program called Nagios: http://www.nagios.org

    It works well and can check your server for many different things that can be happening and even alert you to them. This can help you a lot when trying to find the perfect balance.

    Also, sometimes there are things that your server is doing besides just simply running your rails instances, it might be running scripts or processing information that isn’t necessary. Make sure that your server isn’t doing things it doesn’t need to be doing, that way you save an many cpu cycles and RAM as possible.

    Also, make sure that you are implementing this feature that Unicorn has, we do in our projects and it is invaluable:

    Memory Growth When a worker is using too much memory, god or monit can
    send it a QUIT signal. This tells the worker to die after finishing
    the current request. As soon as the worker dies, the master forks a
    new one which is instantly able to serve requests. In this way we
    don’t have to kill your connection mid-request or take a startup
    penalty. — Taken from: https://github.com/blog/517-unicorn

    I also found this similar question that could give you some insight:

    https://serverfault.com/q/369811/110682

    I hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ruby on rails app running a server and sometimes it needs
I have a Ruby on Rails app running on my server, and I can't
I'm running Teambox (a Ruby on Rails app) and have the server running with:
I've got a Rails 3.2 app running on Ruby 1.9.3 that returns JSON data
The server is running off Ruby on Rails. Javascript is written using Coffeescript. I
I have a Ruby on Rails app that needs process many background jobs simultaneously:
If I have a Ruby on Rails application running on my Apache shared server
I'm running Jenkins 1.424.2 for a Ruby on Rails app and I want to
I have a Rails 3.1 app, running on Ruby 1.9.2, Mongo 2.0.2, using Mongoid
I have a Ruby on Rails app that I'm working on and I'm having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.