Joshua Chamas
Sat, 02 Sep 2000 16:29:14 -0700
Greg Stark wrote: > > Stas Bekman <[EMAIL PROTECTED]> writes: > > > But adds an additional stat() call for each request, which might be not > > desired for "some" sites... I know it's quite fast. See: > > >http://thingy.kcilink.com/modperlguide/performance/Reducing_the_Number_of_stat_Ca.html > > > > But, yeah it's cool! > > In practice I find that stat calls are a minor performance factor when > compared with database calls so for any fairly dynamic site it's not a big > factor. > > However, perhaps a better tradeoff for a production site would be to perform > these stat calls in the parent just before a graceful restart. Then to force > rereading the library files without any downtime the you would just do a > graceful restart, which would recompile all the .pm files and then start > spawning new children with optimal shared memory behaviour:) > > I believe Apache::ASP's internal mechanism is capable of this now. > Yes, to have Apache::ASP reload scripts and libraries just at restart, for normal scripts config do: PerlSetVar StatScripts 0 PerlSetVar StatINC 0 # default Then for a perl restart handler, register a sub which calls Loader() sub restart { Apache::ASP->Loader( '/path/to/scripts/', '\.asp$|$other_pattern_match' StatINC => 1, %OtherConfigs ); } This will make your web site only change upon server graceful restart, and saves some stat() calls. The StatINC mechanism is similar to what is provided by Apache::Reload and Apache::StatINC. Note that I would not use this method much, as the restart handler last I checked seems to leak 1M RAM for each graceful, but this is a nicer way to republish your web site than doing a hard stop/start -- Joshua _________________________________________________________________ Joshua Chamas Chamas Enterprises Inc. NodeWorks >> free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com 1-714-625-4051