[Catalyst] two Catalyst flaws
please don't blame me if I'm wrong here. just point it out and I'll apologize :-) the first is to load all modules at beginning. I want to ask why? for $c-forward()? I think $c-model() can load when called. why I hate this is because it eats too many memory. one of my App has 80+ pm then it takes 150+M. I can't afford that! the second one is hard to use model in cron pl. I know we can do something like my $c = MyApp-prepare(); or Catalyst::Model::Adaptor (trust me, that's not so easy or fast) why I can't get a simple $c without function forward, without req, without res. just get $c-model and $c-cache like? I don't want this $c to load any Controller modules or View modules. anyway, Catalyst is a great framework. it ease our development a lot. Thanks for all your work, Catalyst Team! -- Fayland Lam // http://www.fayland.org/ Foorum based on Catalyst // http://www.foorumbbs.com/ ___ 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] two Catalyst flaws
On Thursday 03 January 2008 10:51:47 Fayland Lam wrote: please don't blame me if I'm wrong here. just point it out and I'll apologize :-) the first is to load all modules at beginning. I want to ask why? for $c-forward()? I think $c-model() can load when called. why I hate this is because it eats too many memory. one of my App has 80+ pm then it takes 150+M. I can't afford that! I guess that's because Catalyst loads once and then stays loaded and handle your clients requests until you restart your server. Sooner or later you will use all your modules, then why not load it all at once instead of using extra time on loading it later? A normal mistake of managing web servers these days is to put tons of web applications onto one server and letting them fight over resources. Servers (and memory in particular) is a low cost factor (compared to development costs). Then why not give your lovely web application some GB's of memory? the second one is hard to use model in cron pl. I know we can do something like my $c = MyApp-prepare(); or Catalyst::Model::Adaptor (trust me, that's not so easy or fast) why I can't get a simple $c without function forward, without req, without res. just get $c-model and $c-cache like? I don't want this $c to load any Controller modules or View modules. anyway, Catalyst is a great framework. it ease our development a lot. Thanks for all your work, Catalyst Team! -- Knut-Olav Hoven Systemutvikler mob: +47 986 71 700 Linpro AShttp://www.linpro.no/ signature.asc Description: This is a digitally signed message part. ___ 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] two Catalyst flaws
Fayland Lam wrote: the first is to load all modules at beginning. I want to ask why? for $c-forward()? I think $c-model() can load when called. why I hate this is because it eats too many memory. one of my App has 80+ pm then it takes 150+M. I can't afford that! You don't mention how you are running the catalyst application, I presume you're using fastcgi or mod_perl or some other long running persistent process ? In which case you want to load everything first, particularly in mod_perl so it can be shared between processes. In any event, the answer is to throw more ram at it, ram is cheap and it's not really worth trying to optimise for low ram conditions. the second one is hard to use model in cron pl. I know we can do something like my $c = MyApp-prepare(); or Catalyst::Model::Adaptor (trust me, that's not so easy or fast) why I can't get a simple $c without function forward, without req, without res. just get $c-model and $c-cache like? I don't want this $c to load any Controller modules or View modules. Catalyst is a web application framework. You have two choices: 1. Use a simple LWP type script in cron to call the necessary web URI and let the server do the heavy lifting; or 2. Make sure you encapsulate the business logic in the model and not in the controller, then you can just load the necessary schema classes and ignore catalyst entirely. In the latter case there's still some work to do if you want to have a shared config file but that's not too hard to figure out. Simon. ___ 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] two Catalyst flaws
Simon Catalyst is a web application framework. You have two choices: 1. Use a simple LWP type script in cron to call the necessary web URI and let the server do the heavy lifting; or 2. Make sure you encapsulate the business logic in the model and not in the controller, then you can just load the necessary schema classes and ignore catalyst entirely. In the latter case there's still some work to do if you want to have a shared config file but that's not too hard to figure out. There's a Catalyst advent calendar article showing how to do this: http://catalyst.perl.org/calendar/2007/14 Regards, Peter http://perl.dragonstaff.co.uk ___ 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] two Catalyst flaws
A normal mistake of managing web servers these days is to put tons of web applications onto one server and letting them fight over resources. Servers (and memory in particular) is a low cost factor (compared to development costs). Then why not give your lovely web application some GB's of memory? Absolutely. Memory is cheap, about 1GB / hour of programmer time at any decent rate. (Crucial, 2GB for £52.). If it takes you more than an hour to reduce the memory footprint of your app, buy your server more RAM :) -- Mike Whitaker| Yahoo! UK Ltd - internal CMS team [EMAIL PROTECTED] | Perl developer, writer, guitarist, photographer Y!: tuxservers | Blog: http://perlent.blogspot.com/ IRC: Penfold | CatSwag: http://www.cafepress.com/catalystdev ___ 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] two Catalyst flaws
On Thu, 3 Jan 2008, Peter Edwards wrote: In the latter case there's still some work to do if you want to have a shared config file but that's not too hard to figure out. There's a Catalyst advent calendar article showing how to do this: http://catalyst.perl.org/calendar/2007/14 I did something sort of similar for VegGuide.Org, except the config simply lives in a single module (VegGuide::Config) that is designed to be usable for Catalyst and outside of it. Basically, it has lots of class methods that return various config items, and also a few methods for returning Catalyst-structured config, CatalystImports() and CatalystConfig(). http://svn.urth.org/filedetails.php?repname=RegVegpath=%2Ftrunk%2Flib%2FVegGuide%2FConfig.pmrev=0sc=0 -dave /*=== VegGuide.Orgwww.BookIRead.com Your guide to all that's veg. My book blog ===*/ ___ 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/