Poor Rails performance when run on Redhat

Hi,

We have developed a small RoR app that runs fine on a standard IBM thinkpad (1GB mem) but runsmuch slower when on an IBM x460 Redhat machine (32GB ram).

The x460 server has hardly any thing running on it at present, so that not the issue.

We are busy checking the config and permissions of the user account used to run the app., but I was wondering if you guys have heard anything about redhat and RoR, that maybe causing this issue?

Cheers

Andrew

Charles Lamper wrote:

snipped

> used to run the app., but I was wondering if you guys have heard > anything about redhat and RoR, that maybe causing this issue?

Not really enough detail to go off of. What web server are you using? Are you using Mongrel? Etc.

I have Rails up and running on Fedora Core 5 using LightSpeed's LSAPI web server. Haven't had issues yet.

-- Posted via http://www.ruby-forum.com/.

Yes its ruby 1.3.4, mongrel-0.3.13.3 with Apache 2.2.

These have been compiled onthe 64bit redhat machine and work fine (albiet slow)

Andrew

Charles Lamper wrote:

andrewmcdonagh@gmail.com wrote:

Charles Lamper wrote: > > > Yes its ruby 1.3.4, mongrel-0.3.13.3 with Apache 2.2. > > Ruby 1.3.4? Or 1.8.4? > > -- > Posted via http://www.ruby-forum.com/.

Jes's too much coffee for me today !

yep 1.8.4

The performance problems seem to be in the rendering of the pages (takes around 5 seconds for 10 fields whereas the db call takes less than a second) and then their posting to the user browser. Network latency is ok (not brilliant,but ok)

I would try using lighttpd just for the sake of verifying if its webserver or an OS issue.

This sounds like a config problem for sure. Your best approach at this point is to breakdown the performance of each deployed component and compare them to what your little thinkpad has.

I'd test them in this order:

1) mongrel in production mode running a testapp with one controller/action that just renders "test" 2) same as #1 but add in a single simple DB query. 3) Then, test your fronting web server only. 4) Next the connection between front and mongrel servers by actually hitting the #1 and #2 tests so that you test the proxy server connection.

I'm thinking you'll find your perf for #1 and #3 are great, then #2 is pathetic which means your DB config isn't right.

You might be forwarding static cotent requests to the Mongrel servers (which handle those slowly) check your apache conf file relating to the mod_proxy redirects

Charles Lamper wrote:

Don Miguel de los Platanos wrote:

I would try using lighttpd just for the sake of verifying if its webserver or an OS issue.

Yeah along those lines, we have installed our app on a desktop fedora box running webrick. It fly's

Tomorrow we'll install mongrel and apache on it to see if its ok. If it is, then there's somethign up with the server's config .

marklennox wrote:

You might be forwarding static cotent requests to the Mongrel servers (which handle those slowly) check your apache conf file relating to the mod_proxy redirects

Yeah I thought that might be an issue, luckily I've already confirmed thats not happening

Andrew

Zed A. Shaw wrote:

Can you try running webrick to see what its performance is like? --just curious

x1 wrote:

Can you try running webrick to see what its performance is like? --just curious

>

We tried this today. Browsing directly to webrick instead of via apache, the performance is the same. We tried lighttpd too - same performance.

Later, we found apache we hadn't configured apache fully, so it was not serving the static contents, mongrel or webbrick were (depending upon which of them was running). Once fixed, the difference was minor.

We tested the same app on a fedora box running apache & mongrel, just mongrel, just webbrick. Each test showed perfect performance.

Its when its run onthe 64bit x460 boxes it grinds...

So, it seems the issue is something to do with the config of redhat itself.

We are going to install the same setup on a desktop redhat (everything running the same), to see what performance is like. This way we can get into the box as root, so we'll be able to play a bit more with settings. The current servers are corporate ones which we have limited leway to change things.

I'll post an update on monday.

Thanks all for yours suggestions

Andrew

You know, if you have a support license with redhat you should start using it. Especially since you can show Fedora running fast and their setup running slow as dirt. Should be a slam dunk and if they can't fix it send the damn thing back and just buy a box yourself to put Fedora on.

For the speed tests, are you accessing it locally(http://localhost or from another host?

Ruby and rails are both running from local disk slices correct? Nothing like an NFS out in california? :slight_smile:

Have you run any pure ruby ( command line ) benchmarks to check the interpreters performance ?