Re: [Mongrel] Optimal Configuration

2006-08-23 Thread Zed Shaw
On Wed, 2006-08-23 at 10:07 +0100, Tim Perrett wrote:
 Hey all
 
 First off, ive just switched to using mongrel_cluster and pound - its
 working a treat! Its far far faster than fast-cgi: operations that took a
 few seconds on fcgi now are almost instant with mongrel. Excellent!
 
 However, I've been trying to decide how best to utilise my equipment most
 effectively. I have a dual pro 3Ghz Xenon with 2GB RAM, and the server will
 be running a few different applications - some rails, some php. Seeing as I
 was using lighty before I switched im keeping my PHP on lighty and proxying
 through pound but my rails apps are now on mongrel, but how many instances
 would deliver the best performance on what im running? I wasn't sure if
 mongrel got busy would it hog a lot of ram or something like that.

The best way to find your utilization sweet spot is to do something
like the following:

1) Write a simple rails app with a test controller that just returns the
word test with render text.  This is the fastest little rails action
you could have, so make sure your configuration is tight an this is the
fastest.  Do this with just one mongrel and measure it using ab or
httperf.
2) Once you have a single mongrel running well, proceed to add mongrels
and retest (make sure you increase the concurrency too) until adding
mongrels doesn't improve performance of this fastest action.
3) This is probably your sweet spot, now just run these tests on the
various actions you have in your real app and see how everything works
for ram and cpu usage.

After that you'll have to get into different configs, tuning your OS,
etc. but at least you'll have found a good start.

Also, retest this same scenario when new versions of rails come out or
you deploy a new version of your app.  Every time the conditions of your
last test change you need to re-run them.  It's just like unit testing,
you gotta keep doing it or it's pointless.


-- 
Zed A. Shaw
http://www.zedshaw.com/
http://mongrel.rubyforge.org/
http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.

___
Mongrel-users mailing list
Mongrel-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-users


Re: [Mongrel] Multiple mongrels for one app

2006-08-23 Thread hax

 You actually can find out for yourself right now.  I have the latest
 pre-release up with a new debugging feature just for folks like you.

 First, install the pre-release like this:

   sudo gem install mongrel
 --source=http://mongrel.rubyforge.org/releases/

 Then run your application in production mode like normal.  Right after
 it starts up, do this:

   killall -USR1 mongrel_rails

 Go look at the log/mongrel.log and you'll see that it says it set
 $mongrel_debug_client to true.  The USR1 signal toggles this client
 debugging true/false.  When it's true Mongrel will print out log
 messages that help you debug client interactions:

 * BAD CLIENT is only logged now when USR1 is on.
 * Full request data is printed out when there's an HTTP parsing  
 error so
 you can see what the problem is.
 * It will print the number of threads waiting for rails on 10 second
 intervals.
 * It prints stack traces for exceptions found (I'm expanding this  
 more).

 It's also very light, so you could enable it all the time if you want.

 Now, what you want to do is hit your app with httperf like this:

 httperf --server 127.0.0.1 --port 3000 --uri /some/rails/uri --num- 
 conns
 1000 --rate 100

 And then watch your mongrel.log print out the request counts as they
 pile up behind rails and then move out.  Play with num-conns and rate
 until you can choke mongrel, find the sweet spot, etc.

 Have fun and let me know if you find bugs.

Wow, amazing responses, that answers every question I could have  
possibly had plus more :)

Thanks everyone!

Also, Zed, you rock :)

--hax
___
Mongrel-users mailing list
Mongrel-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-users


Re: [Mongrel] Optimal Configuration

2006-08-23 Thread Philip Hallstrom
 First off, ive just switched to using mongrel_cluster and pound - its
 working a treat! Its far far faster than fast-cgi: operations that took a
 few seconds on fcgi now are almost instant with mongrel. Excellent!

 However, I've been trying to decide how best to utilise my equipment most
 effectively. I have a dual pro 3Ghz Xenon with 2GB RAM, and the server will
 be running a few different applications - some rails, some php. Seeing as I
 was using lighty before I switched im keeping my PHP on lighty and proxying
 through pound but my rails apps are now on mongrel, but how many instances
 would deliver the best performance on what im running? I wasn't sure if
 mongrel got busy would it hog a lot of ram or something like that.

 What would people suggest from there own experiences?

http://rubyforge.org/pipermail/mongrel-users/2006-May/000200.html
___
Mongrel-users mailing list
Mongrel-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-users