librelist archives

« back to archive

Dynamically change configuration (no restart)

Dynamically change configuration (no restart)

From:
briche arnaud
Date:
2011-07-11 @ 20:34
Hi everyone,
   I recently decided to switch my VPS to Mongrel2 (coming from
Nginx) because I wanted to be able to dynamically change the
configuration without having to restart the server.
Most of my web services are written with node.js, python/flask,  and
scala/play; I use upstart jobs to start/stop services,  and I would
like to be able to modify Mongrel2
configuration from these jobs so that when I start a service, Mongrel2
can imediately route the requests to it, and stop  when I stop the
service.
I would like to be able to store the config in a redis instance, or a
database accessible from the network.
So, first, is this possible with Mongrel2, and if so, do you have some
advices on how to accomplish this ?

Thx in advance.

Re: [mongrel2] Dynamically change configuration (no restart)

From:
Zed A. Shaw
Date:
2011-07-13 @ 17:17
On Mon, Jul 11, 2011 at 10:34:56PM +0200, briche arnaud wrote:
> Hi everyone,
>
> I would like to be able to store the config in a redis instance, or a
> database accessible from the network.
> So, first, is this possible with Mongrel2, and if so, do you have some
> advices on how to accomplish this ?

Yes, it's possible, but a bit rough right now since I've only recently
got the reload code and the config modules working.  If you grab the
latest develop branch from our git repo you can get the new reload code.
It does a really fast and reliable hot reload that's being used for this
purpose.

For the configs out of redis you'd have to write a config handler for
it, but I think if you wait a bit I'll have a ZeroMQ generic handler and
you could just write something to that.

-- 
Zed A. Shaw
http://zedshaw.com/