Ask A Question

Notifications

Youโ€™re 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 โ˜ฎ๏ธ
Karim

Reply

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;

Reply

That should keep however many cores you have busy :)

Reply

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?

Reply

@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.

Reply

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

Reply

For more info, check this out Passenger/Nginx reference

Reply
Join the discussion
Create an account Log in

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

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

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