Topic: Additional CPUs added - Do we need to re-compile source?

Hi all,

New to this forum.  New to Ruby on Rails as well.

We have a virtual server that hosts our Ruby on Rails application.  The original build of Ruby on Rails was on the server when it only had 1 CPU.  We are about to expand that to multiple CPUs.  We've had some issues as the single CPU is pegged all the time and the Rails server occassionally 'checks out'.

My question, Once the new CPUs are added, do we need to re-compile (build) from source the Ruby on Rails code in order for the C/C++ too see the new CPUs?

I know in my previous experiences with C/C++, we had to do things like this for some Open Source applications we were using...

tia,

adym

Re: Additional CPUs added - Do we need to re-compile source?

In short, no. you don't compile Rail or the apps you build with it. Well you can but there is rarely a need to.

The rails server (passenger, nginx, unicorn or whatever) will just process the code in whtever way it normally does and the cpu/bios of the system that is handling the cpu cores will spread the load accordingly.

Having said that, I use an nginx setup with unicorn on a linode and I configure the numbr of workers according to the amount of ram and cpu power I have to take full advantage of any pare capacity, but all that means is that the server will have more idle threads running to pick up heavy work loads, leaving an impression of faster first time hit.

What you want and what you need are too often not the same thing!
When your head is hurting from trying to solve a problem, stop standing on it. When you are the right way up you will see the problem differently and you just might find the solution.
(Quote by me 15th July 2009)

Re: Additional CPUs added - Do we need to re-compile source?

James,

Thank you for the response...reading your answer has got me thinking about more questions...

Is there a web page (documentation) on how to configure the number of workers you mentioned above?

I've been reading thru the following site [http://guides.rubyonrails.org/configuring.html], but there's nothing (I've found) on workers...

I need to do some reading on these types of things...While I'll be doing some coding my main effort here will be focused on keeping the environment, server up and running.

tia,

adym

Re: Additional CPUs added - Do we need to re-compile source?

You might find these railscasts really useful.
http://railscasts.com/episodes/293-nginx-unicorn
http://railscasts.com/episodes/335-deploying-to-a-vps
http://railscasts.com/episodes/337-capistrano-recipes

You might have to subscribe to watch some (not sure as I subscribe so I can see all) but if you do then give it serious consideration for a month

What you want and what you need are too often not the same thing!
When your head is hurting from trying to solve a problem, stop standing on it. When you are the right way up you will see the problem differently and you just might find the solution.
(Quote by me 15th July 2009)