Re: [Catalyst] auto re-load of application yaml config file?
On Jul 24, 2008, at 10:16 PM, Jonathan Rockway wrote: * On Thu, Jul 24 2008, Pedro Melo wrote: And yes, the tradeoff is mod_perl, which is more complex than FCGI. How does Perlbal require mod_perl? I would just run the application's own HTTP server behind Perlbal. Not very complex at all. It does not. If I implied otherwise it was not what I meant. The assertion is that mod_perl is slightly more complex than FCGI for some. I have no problem with that assertion, although I only use mod_perl myself because I prefer to use HTTP all the way, and I find apache2+mod_perl2 the most stable application environment for Perl. You can perfectly use Perlbal with Apache|Lighttpd|Nginx+FastCGI. Best regards, -- Pedro Melo Blog: http://www.simplicidade.org/notes/ XMPP ID: [EMAIL PROTECTED] Use XMPP! ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] auto re-load of application yaml config file?
Hi, On Jul 24, 2008, at 3:33 AM, Matt S Trout wrote: On Wed, Jul 23, 2008 at 11:26:18PM +0100, Pedro Melo wrote: On Jul 23, 2008, at 4:32 AM, Matt S Trout wrote: On Tue, Jul 22, 2008 at 12:53:10PM +0200, Marc Sebastian Pelzer wrote: Hello, I'm running a Catalyst application under mod_perl and wonder if there is a Plugin available that detects changes on the main application .yml config file and does a automatic re-load if needed? It not - what would be the most elegant (and less I/O intensive) way of doing this? Would it be enough to do a __PACKAGE__-config( 'Plugin::ConfigLoader' = { file = 'my_config.yml' } ); in my Root controller when I detect a change? Nope. apache2ctl restart, minimum. You may find external FastCGI and a handler swap is a better approach. Or mod_perl backends (old and new) and a decent load balancer like perlbal. Same approach. Different technologies. I find getting two FastCGI handlers running much less of a pain in the arse than getting two mod_perl instances running - the distro stuff tends to get in the way and even once I've beaten it out of the way it's much more work than FCGI. 100% agreed. I'm just pointing Perlbal because it is a extremely flexible HTTP load balancer. You can do stuff like redirecting a single user to a different server to diagnose a problem they are having, or moving from version N to version N+1 of your app only at certain safe points (like login). We use all of these plus, we can have a pre-production environment on the same domain. All with Perlbal handlers. And yes, the tradeoff is mod_perl, which is more complex than FCGI. Best regards, -- Pedro Melo Blog: http://www.simplicidade.org/notes/ XMPP ID: [EMAIL PROTECTED] Use XMPP! ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] auto re-load of application yaml config file?
* On Thu, Jul 24 2008, Pedro Melo wrote: And yes, the tradeoff is mod_perl, which is more complex than FCGI. How does Perlbal require mod_perl? I would just run the application's own HTTP server behind Perlbal. Not very complex at all. -- print just = another = perl = hacker = if $,=$ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] auto re-load of application yaml config file?
On Jul 23, 2008, at 4:32 AM, Matt S Trout wrote: On Tue, Jul 22, 2008 at 12:53:10PM +0200, Marc Sebastian Pelzer wrote: Hello, I'm running a Catalyst application under mod_perl and wonder if there is a Plugin available that detects changes on the main application .yml config file and does a automatic re-load if needed? It not - what would be the most elegant (and less I/O intensive) way of doing this? Would it be enough to do a __PACKAGE__-config( 'Plugin::ConfigLoader' = { file = 'my_config.yml' } ); in my Root controller when I detect a change? Nope. apache2ctl restart, minimum. You may find external FastCGI and a handler swap is a better approach. Or mod_perl backends (old and new) and a decent load balancer like perlbal. Best regards, -- Pedro Melo Blog: http://www.simplicidade.org/notes/ XMPP ID: [EMAIL PROTECTED] Use XMPP! ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] auto re-load of application yaml config file?
On Wed, Jul 23, 2008 at 11:26:18PM +0100, Pedro Melo wrote: On Jul 23, 2008, at 4:32 AM, Matt S Trout wrote: On Tue, Jul 22, 2008 at 12:53:10PM +0200, Marc Sebastian Pelzer wrote: Hello, I'm running a Catalyst application under mod_perl and wonder if there is a Plugin available that detects changes on the main application .yml config file and does a automatic re-load if needed? It not - what would be the most elegant (and less I/O intensive) way of doing this? Would it be enough to do a __PACKAGE__-config( 'Plugin::ConfigLoader' = { file = 'my_config.yml' } ); in my Root controller when I detect a change? Nope. apache2ctl restart, minimum. You may find external FastCGI and a handler swap is a better approach. Or mod_perl backends (old and new) and a decent load balancer like perlbal. Same approach. Different technologies. I find getting two FastCGI handlers running much less of a pain in the arse than getting two mod_perl instances running - the distro stuff tends to get in the way and even once I've beaten it out of the way it's much more work than FCGI. But sure, either is good. Choose your poison according to your own tastes :) -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Directorhttp://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] auto re-load of application yaml config file?
Hello, I'm running a Catalyst application under mod_perl and wonder if there is a Plugin available that detects changes on the main application .yml config file and does a automatic re-load if needed? It not - what would be the most elegant (and less I/O intensive) way of doing this? Would it be enough to do a __PACKAGE__-config( 'Plugin::ConfigLoader' = { file = 'my_config.yml' } ); in my Root controller when I detect a change? Also, is there a way to store the state (maybe the mtime of the config file) in memory without being lost between requests? Or do I need to store the mtime in a database/memcache/tempfile (which would be expensive)? Many thanks in advance for any hint :) ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] auto re-load of application yaml config file?
* On Tue, Jul 22 2008, Marc Sebastian Pelzer wrote: Hello, I'm running a Catalyst application under mod_perl and wonder if there is a Plugin available that detects changes on the main application .yml config file and does a automatic re-load if needed? It not - what would be the most elegant (and less I/O intensive) way of doing this? Would it be enough to do a __PACKAGE__-config( 'Plugin::ConfigLoader' = { file = my_config.yml' } ); in my Root controller when I detect a change? Also, is there a way to store the state (maybe the mtime of the config file) in memory without being lost between requests? Or do I need to store the mtime in a database/memcache/tempfile (which would be expensive)? Many thanks in advance for any hint :) Reading the config file causes a lot of things to happen (instantiating your controllers with certain arguments, for example), so this won't work. You really need to just restart the app from scratch when you change the config. If you want lightweight on-the-fly configurability, you should roll your own. You will have to engineer something with a compromise that meets your needs. For example, checking the database every time you read a variable will mean the config settings update quickly, but you also slow your app way down. YMMV and all that ;) Regards, Jonathan Rockway -- print just = another = perl = hacker = if $,=$ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/