Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Dynamically add/remove mongrel on EC2 from Apache balancer
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Yaxm Yaxm  
View profile  
 More options Feb 18 2008, 7:41 pm
From: Yaxm Yaxm <ruby-forum-incom...@andreas-s.net>
Date: Tue, 19 Feb 2008 01:41:04 +0100
Local: Mon, Feb 18 2008 7:41 pm
Subject: Dynamically add/remove mongrel on EC2 from Apache balancer
Hi,

I'd like to scale out by adding more EC2 mongrel instances, and scale
down by removing EC2 mongrel instances.

Is there a way to dynamically add/remove mongrel instances from Apache
mod_proxy_balancer.  It seems that I'd have to manually change the
configuration file and restart apache whenever I add/remove a new
mongrel.

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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
digitalronin  
View profile  
 More options Feb 19 2008, 5:05 am
From: digitalronin <da...@digitalronin.com>
Date: Tue, 19 Feb 2008 02:05:30 -0800 (PST)
Local: Tues, Feb 19 2008 5:05 am
Subject: Re: Dynamically add/remove mongrel on EC2 from Apache balancer

> Is there a way to dynamically add/remove mongrel instances from Apache
> mod_proxy_balancer.  It seems that I'd have to manually change the
> configuration file and restart apache whenever I add/remove a new
> mongrel.

Well, you could write a script to edit the config for you and send
apache a usr1 signal ( "kill -usr1 [pid]" ) to cause it to reload the
updated config, then trigger the script whenever a new EC2 instance is
started or stopped.

Another approach could be to proxy everything to swiftiply (
http://swiftiply.swiftcore.org/ ), and have each new EC2 instances
mongrels register/deregister with the swiftiply proxy.

Yet another option would be to use switchpipe ( http://switchpipe.org/
) to manage things.

I haven't done any of these, of course, so I'm basically talking
through my hat, but they all sound plausible!

Good luck

David


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Copeland  
View profile  
 More options Feb 19 2008, 10:00 am
From: Tom Copeland <t...@infoether.com>
Date: Tue, 19 Feb 2008 10:00:23 -0500
Local: Tues, Feb 19 2008 10:00 am
Subject: Re: [Rails-deploy] Dynamically add/remove mongrel on EC2 from Apache balancer

On Tue, 2008-02-19 at 01:41 +0100, Yaxm Yaxm wrote:
> Is there a way to dynamically add/remove mongrel instances from Apache
> mod_proxy_balancer.  It seems that I'd have to manually change the
> configuration file and restart apache whenever I add/remove a new
> mongrel.

mod_proxy_balancer comes with the "balancer manager" with which can
toggle a member of the cluster offline and back online:

http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html

You could script that interface and then call it from Capistrano.  I
Googled around but couldn't find an existing library for this... kind of
surprising.  Maybe most folks are just going the "rewriting the config
file and send USR1" route.

Yours,

Tom


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Cooper  
View profile  
 More options Feb 22 2008, 1:51 pm
From: Peter Cooper <pcoo...@gmail.com>
Date: Fri, 22 Feb 2008 10:51:07 -0800 (PST)
Local: Fri, Feb 22 2008 1:51 pm
Subject: Re: Dynamically add/remove mongrel on EC2 from Apache balancer

On Feb 19, 10:05 am, digitalronin <da...@digitalronin.com> wrote:

> > Is there a way to dynamically add/remove mongrel instances from Apache
> > mod_proxy_balancer.  It seems that I'd have to manually change the
> > configuration file and restart apache whenever I add/remove a new
> > mongrel.

> [snip]

> Yet another option would be to use switchpipe (http://switchpipe.org/
> ) to manage things.

Yep, that's exactly what SwitchPipe does. Dynamically launches,
manages, and kills backend processes that speak HTTP. Even better than
that, it'll kill Mongrels that aren't in use for a certain period of
time.. so rather than having, say, 3 Mongrels running ALL the time on
a quiet app, it'll scale it back to zero Mongrels after X seconds of
inactivity if you like. Alternatively you can make it keep 1 Mongrel
up to pick up requests before scaling up to meet demand. Whatever you
want to do, it does it.

Cheers,
Peter Cooper
http://www.petercooper.co.uk/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
daniel wharton  
View profile  
 More options Mar 4 2008, 11:56 am
From: daniel wharton <dwhar...@gmail.com>
Date: Tue, 4 Mar 2008 08:56:29 -0800 (PST)
Local: Tues, Mar 4 2008 11:56 am
Subject: Re: Dynamically add/remove mongrel on EC2 from Apache balancer
While dorking around, I found you can disable/enable mongrel instances
in apache via curl.  I added these two functions to my mongrel init
file:

enable_mongrel ()
{
    curl -s -o /dev/null http://127.0.0.1:8888/balancer-manager\?b=mongrel_cluster\&w=http://127.0.0.1:$1\&dw\=ENABLE

}

disable_mongrel ()
{
    curl -s -o /dev/null
http://127.0.0.1:8888/balancer-manager\?b=mongrel_cluster\&w=http://127.0.0.1:$1\&dw\=DISABLE

}

in the case statement:

    enable)
      enable_mongrel $2
      RETVAL=$?
  ;;
    disable)
      disable_mongrel $2
      RETVAL=$?
  ;;

They accept the port number as an option.  I use this as part of my
monit system to keep things in check.  I have a very high traffic site
and I found proxy_balancer didn't react quick enough.

usage:

service monit disable 8081
service monit enable 8081

On Feb 22, 1:51 pm, Peter Cooper <pcoo...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google