All threads / How do I take advantage of multiple CPUs on a DigitalOcean droplets?
Ask A Question


You鈥檙e not receiving notifications from this thread.

How do I take advantage of multiple CPUs on a DigitalOcean droplets?

Karim Tarek asked in Servers

Hello 馃憢

I've a two Rails apps hosted on a droplet that has multiple CPUs.
Honstly I don't know what does that mean for the app and if I need to do any thing to take advantage of that or does Rails already does that? Please advice 馃槉

Thanks 鈽笍

Basically, you specify that your rails app run "8 processes" at once and each will use one core. The way it can be done is by using phusion passenger (with Nginx) and set the following parameters
passenger_max_pool_size 8;
passenger_max_instances_per_app 8;

That should keep however many cores you have busy :)

Thanks @James, any idea how to set those params if I deploy using Hatch?
I guess I'm gonna have to SSH, so where should I put those?

@karim I don't know anything about hatch, I just use straight servers without the bells/whistles. But the configuration declarative should go in your nginx host block.

Thanks @James, it looks like I'm gonna have to do some digging then :)
I really appreciate your feedback.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 68,326+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.