On 2007-09-18 11:27:25 -0400, John L wrote:
> Well, now I restarted it and the load is a reasonable 3 to 5.  Must have 
> been a spam blast, will have to wait and see if it happens again.
> 
> I see a lot of plugins that read config files in the hook routines. 
> Seems to me that in forkserver, that means each fork will reread the file, 
> and it'd be faster if I read the config in the register routine and put 
> the array into $self->{_whatever} so it'll be inherited in the fork.
> 
> Sound reasonable?

Yes. But only if you can restart the server every time you change one of
the config files. 

For config files which change relatively frequently and are relatively
large, a better approach is to use the pre-connection hook to check if
the file has changed and re-read it if necessary. That way there is
normally only a single stat per config file and connection. When the
config file changes it must be read again, which will block the parent
for a short time, but after that all children will again use the new
config.

> Each file is pretty small, but in aggregate there are a 
> lot of them.

Unfortunately, statting lots of files takes time, too. 

        hp

-- 
   _  | Peter J. Holzer    | I know I'd be respectful of a pirate 
|_|_) | Sysadmin WSR       | with an emu on his shoulder.
| |   | [EMAIL PROTECTED]         |
__/   | http://www.hjp.at/ |    -- Sam in "Freefall"

Attachment: signature.asc
Description: Digital signature

Reply via email to