From:
<ant...@he...> - 2005-07-05 21:41:58
|
Perrin Harkins wrote: >>it _still_ did all of the initializations twice >>with OI2. > I haven't looked at how OI2's startup is organized, but this is probably > fixable. Things called from PerlModule or PerlRequire will be run > twice, but modules loaded inside of that will not. OI2 initializes a singleton Context object on startup (through PerlRequiring a startup.pl) which contains quite a lot of various data. I'm not quite sure how to prevent the Context from initializing twice but I suppose it could be fixed. Hmm.. Could we just check if the singleton object already exists in the memory and not initialize it twice? Why didn't I think of this before? But well I'm not bugged by this anymore so those who are can try if it works ;) > I still don't understand what you're saying FastCGI does though. > Doesn't it also keep the interpreter alive in memory? It doesn't do anything special. If I restart apache, the FastCGI server stops and it starts again only when I issue the next request for it. This way it gets fully initialized with the current data. Since we can't use Apache::Reload (at least atm) this is what you would want it to do when developing for OI2. At least for me it is a huge difference that I don't have to watch the mod_perl apache to start (which takes quite some time) and issue my request after it has finished - I can just issue the request and it is executed instantly when the initialization is completed. > No, it's just a fork. Forking is very fast on linux and none of the > memory gets copied until the pages are dirty. Yes, it is just a fork and the forking is really cheap but there is no way to prevent mod_perl from polluting also much of the static data shared with the parent process according to this: http://perl.apache.org/docs/1.0/guide/performance.html#toc_Sharing_Memory Since the execution path of OI2 is long, large amounts of the data gets dirty along the way. > FastCGI forks too. By default, no it doesn't. It's just a single Perl interpreter serving requests one by one. - Antti |