Topic: nginx 0.5.35 with 2/4/8 mongrels - slow slow slow

Our sysadmin has been benchmarking this new Rails application, we've tried different setups, from 2 to 8 mongrels behind nginx, the mongrels don't seem to spread the load very well.

Regardless of how many mongrels we set up, a single one seems to be hit with 90M of memory usage and taking the CPU all the way to 80%-90%. All other mongrels, be it 1 or 7 are idling with 0 CPU usage and 20-21M of memory. Huh?

Pasties from the application and nginx conf: http://pastie.org/176632 .

Re: nginx 0.5.35 with 2/4/8 mongrels - slow slow slow

What OS are you using?

Re: nginx 0.5.35 with 2/4/8 mongrels - slow slow slow

Hey mate, it's CentOS release 4.6 (Final).

Re: nginx 0.5.35 with 2/4/8 mongrels - slow slow slow

Did anyone else come across the same issue in the past? Is something wrong with the way I've configured things? Would really appreciate a reply fellas. Cheers.

Re: nginx 0.5.35 with 2/4/8 mongrels - slow slow slow

OK OK OK. Nevermind guys, found the bug, it was a crazy nginx init script that wasn't working as expected.

Any good nginx init scripts for Centos that you could recommend?

Cheers, Gerhard.

Re: nginx 0.5.35 with 2/4/8 mongrels - slow slow slow

Gerhard, did you change something to the config file?

Re: nginx 0.5.35 with 2/4/8 mongrels - slow slow slow

Hey reyntjensw, no, the config file was perfectly fine (well, except for a typo), but the script that I had for starting/stopping nginx wasn't working. The following nginx init script was taken straight from The Rails Way book: http://pastie.org/177819

Even though the OS is CentOS and everything was followed to the dot (configuration, paths, pids etc.), it's just not cutting it. Had to temporarily resort to a start_stop_daemon script from here: http://www.cognovis.de/developer/en/nginx_install . Ugly, but it does the trick.

Last edited by gerhard (2008-04-09 05:59:13)

Re: nginx 0.5.35 with 2/4/8 mongrels - slow slow slow

hi gerhard,

Maybe (if you want) you should try a debian setup. Because debian is alot faster than cent for rails and it's "made" for rails.It's much easyer to install rails on debian, to install plugins,...

Re: nginx 0.5.35 with 2/4/8 mongrels - slow slow slow

Hi reyntjensw, I don't agree with you fully. Is it Rails Machine or Engine Yard that use CentOS on their servers?

CentOS is enterprise, and the company I work for is using them almost exclusively across 100s of servers...

While digging around, I came across this http://rubyworks.rubyforge.org/ , which does seem to have a CentOS version as well. I didn't give it a go just yet, but I'm sure there is a better way to handle nginx rather than that start_stop_deamon from my previous post. Also, I'm looking forward to mod_rails which is due to come out this week. Given the initial benchmarks, it seems quicker than mongrel - not to mention the ease of installation.

As far as I knew, one installs plugins through ruby-gems which works the same regardless of the distro, am I right?

Last edited by gerhard (2008-04-10 04:03:27)