More info that I found, which answers my question. >From Hongli Lai, author of Passenger.
Yes, lazy loaded files are loaded once in each forked process. Though this is no different from Mongrel/Thin, where the same thing happens. You can optimize this by preloading the files in environment.rb, so that the forked worker processes don't have to load them again. This also saves memory if you're using REE. >From Adam, from Pivotal Labs, developers of Desert. Any version of Rails 2.2 or later should eager load classes by default, so this shouldn't be an issue. On Tue, Mar 24, 2009 at 5:59 PM, Andrei Erdoss <[email protected]> wrote: > Hello Bruno, > > This is what I have found from the author of Passenger, Hongli: > This my question: > > Hello, > > > > I am using a plugin that is lazy loading files. By using Passenger as the > > app server, is the performance effected? Does Passenger have to load the > > files over and over again in each fork? > > > > Please help me understand if this would cause a perfomance issue. > > This is his answer: > > Yes, lazy loaded files are loaded once in each forked process. Though > this is no different from Mongrel/Thin, where the same thing happens. > You can optimize this by preloading the files in environment.rb, so > that the forked worker processes don't have to load them again. This > also saves memory if you're using REE. > > My question to you is, how could I preload these files in the > environment.rb, if there are alot of them, in order to improve performance? > > Thanks, > > > On Mon, Mar 23, 2009 at 7:33 PM, Andrei Erdoss <[email protected]> wrote: > >> Please let me know what you find out. Thanks, >> >> Andrei >> >> >> On Mon, Mar 23, 2009 at 6:05 PM, Bruno Bornsztein < >> [email protected]> wrote: >> >>> Ooh, I hadn't noticed that. If desert doesn't work with mod_rails >>> (passenger), that's a no-go for me too. I'll shoot Brian an e-mail and ask >>> him about that. >>> Thanks, >>> Bruno >>> >>> On Mon, Mar 23, 2009 at 4:47 AM, Andrei Erdoss <[email protected]> wrote: >>> >>>> I like your idea. Because I would like to deploy on Passenger, one >>>> thing that is not clear is this comment made by the creator of desert, >>>> Brian >>>> Takita: I havn't tried Desert with mod_rails yet so I'm not sure about all >>>> of the details. >>>> >>>> One thing to note is Desert will lazily load your files and mod_rails >>>> uses fork. This may cause a performance issue if the files are not loaded >>>> in >>>> environment.rb, because each forked process would need to do the same work >>>> to load the files over and over again. >>>> >>>> To fix that issue (if there is one), you would need to show the >>>> constants or require the files within environment.rb. >>>> >>>> For example: >>>> >>>> # environment.rb >>>> >>>> require 'config/boot' >>>> require 'desert' >>>> >>>> Rails::Initializer.run do |config| >>>> # ... >>>> end >>>> >>>> User >>>> AnyOtherModule >>>> require_dependency 'some_controller' >>>> >>>> >>>> >>>> >>>> Do you have any idea how to deal with this in regards to CE? >>>> >>>> >>>> On Fri, Mar 20, 2009 at 4:13 AM, Bruno Bornsztein < >>>> [email protected]> wrote: >>>> >>>>> Anybody have experience using the Desert plugin from Pivotal Labs? ( >>>>> http://pivotallabs.com/users/brian/blog/articles/459-build-your-own-rails-plugin-platform-with-desert >>>>> ) >>>>> >>>>> It seems to have a lot of the good features that Engine has, but also >>>>> supports code mixing in models (which is kind of a pain with Engines). >>>>> Anyone want to take a crack at integrating this with CE to see how it >>>>> goes? >>>>> If it's pretty smooth, it might be a nice alternative to Engines (which >>>>> seems to be losing steam). >>>>> >>>>> Let me know what you think! >>>>> Bruno >>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Andrei Erdoss >>>> >>>> >>>> >>> >>> >>> >>> >> >> >> -- >> Andrei Erdoss >> > > > > -- > Andrei Erdoss > -- Andrei Erdoss --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CommunityEngine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/communityengine?hl=en -~----------~----~----~----~------~----~------~--~---
