This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.
Subject: [ANNOUNCE] Apache::Reload 0.03
From: Matt Sergeant <matt@sergeant.org>
Date: Tue, 29 Aug 2000 13:37:01 +0100 (BST)
Apache::Reload is a drop-in replacement for Apache::StatINC that does so
much more...
It provides two more options beyond StatINC. The first is a way that you
can register modules to be reloaded. To do this, simply add:
use Apache::Reload;
to your module and it will automatically be detected by Apache::Reload as
one that needs to be checked for changes and reloaded on each request. In
this mode of operation, Apache::Reload only checks the change time of
registered modules, thus reducing the overhead of stat calls on every
module in %INC.
The new option with 0.03 is the ability to have a TouchFile. This is a
file somewhere on your filesystem that Apache::Reload stat()s on each
request to see if it has changed. If not it doesn't bother to check any of
your modules for changes. If it has been changed it will do the checks on
all of your registered modules (or all of %INC in the case where you're
using it as a replacement for StatINC).
0.03 also fixed a bug someone reported where lexical hash contents weren't
copied to the Apache children. Switching to a package hash solved this.
On its way to CPAN now. Have fun.
===
Subject: [ANNOUNCE] Apache::Reload 0.04
From: Matt Sergeant <matt@sergeant.org>
Date: Wed, 30 Aug 2000 12:00:48 +0100 (BST)
This release adds the ability to specify modules to reload in the config
file as well as in the module itself. Docs below:
NAME
Apache::Reload - Reload changed modules
SYNOPSIS
In httpd.conf:
PerlInitHandler Apache::Reload
PerlSetVar ReloadAll Off
Then your module:
package My::Apache::Module;
use Apache::Reload;
sub handler { ... }
1;
DESCRIPTION
This module is two things. First it is an adaptation of Randal
Schwartz's Stonehenge::Reload module that attempts to be a
little more intuitive and makes the usage easier.
Stonehenge::Reload was written by Randal to make specific
modules reload themselves when they changed. Unlike
Apache::StatINC, Stonehenge::Reload only checked the change time
of modules that registered themselves with Stonehenge::Reload,
thus reducing stat() calls. Apache::Reload also offers the exact
same functionality as Apache::StatINC, and is thus designed to
be a drop-in replacement. Apache::Reload only checks modules
that register themselves with Apache::Reload if you explicitly
turn off the StatINC emulation method (see below). Like
Apache::StatINC, Apache::Reload must be installed as an Init
Handler.
StatINC Replacement
To use as a StatINC replacement, simply add the following
configuration to your httpd.conf:
PerlInitHandler Apache::Reload
Register Modules Implicitly
To only reload modules that have registered with Apache::Reload,
add the following to the httpd.conf:
PerlInitHandler Apache::Reload
PerlSetVar ReloadAll Off
# ReloadAll defaults to On
Then any modules with the line:
use Apache::Reload;
Will be reloaded when they change.
Register Modules Explicitly
You can also register modules explicitly in your httpd.conf file
that you want to be reloaded on change:
PerlInitHandler Apache::Reload
PerlSetVar ReloadAll Off
PerlSetVar ReloadModules "My::Foo My::Bar Foo::Bar::Test"
Note that these are split on whitespace, but the module list
must be in quotes, otherwise Apache tries to parse the parameter
list.
Special "Touch" File
You can also set a file that you can touch() that causes the
reloads to be performed. If you set this, and don't touch() the
file, the reloads don't happen. This can be a great boon in a
live environment:
PerlSetVar ReloadTouchFile /tmp/reload_modules
Now when you're happy with your changes, simply go to the
command line and type:
touch /tmp/reload_modules
And your modules will be magically reloaded on the next request.
This option works in both StatINC emulation mode and the
registered modules mode.
AUTHOR
Matt Sergeant, matt@sergeant.org
SEE ALSO
Apache::StatINC, Stonehenge::Reload
Subject: [ANNOUNCE] Apache::Reload 0.04--
From: Matt Sergeant <matt@sergeant.org>
Date: Wed, 30 Aug 2000 12:00:48 +0100 (BST)
This release adds the ability to specify modules to reload in the config
file as well as in the module itself. Docs below:
NAME
Apache::Reload - Reload changed modules
SYNOPSIS
In httpd.conf:
PerlInitHandler Apache::Reload
PerlSetVar ReloadAll Off
Then your module:
package My::Apache::Module;
use Apache::Reload;
sub handler { ... }
1;
DESCRIPTION
This module is two things. First it is an adaptation of Randal
Schwartz's Stonehenge::Reload module that attempts to be a
little more intuitive and makes the usage easier.
Stonehenge::Reload was written by Randal to make specific
modules reload themselves when they changed. Unlike
Apache::StatINC, Stonehenge::Reload only checked the change time
of modules that registered themselves with Stonehenge::Reload,
thus reducing stat() calls. Apache::Reload also offers the exact
same functionality as Apache::StatINC, and is thus designed to
be a drop-in replacement. Apache::Reload only checks modules
that register themselves with Apache::Reload if you explicitly
turn off the StatINC emulation method (see below). Like
Apache::StatINC, Apache::Reload must be installed as an Init
Handler.
StatINC Replacement
To use as a StatINC replacement, simply add the following
configuration to your httpd.conf:
PerlInitHandler Apache::Reload
Register Modules Implicitly
To only reload modules that have registered with Apache::Reload,
add the following to the httpd.conf:
PerlInitHandler Apache::Reload
PerlSetVar ReloadAll Off
# ReloadAll defaults to On
Then any modules with the line:
use Apache::Reload;
Will be reloaded when they change.
Register Modules Explicitly
You can also register modules explicitly in your httpd.conf file
that you want to be reloaded on change:
PerlInitHandler Apache::Reload
PerlSetVar ReloadAll Off
PerlSetVar ReloadModules "My::Foo My::Bar Foo::Bar::Test"
Note that these are split on whitespace, but the module list
must be in quotes, otherwise Apache tries to parse the parameter
list.
Special "Touch" File
You can also set a file that you can touch() that causes the
reloads to be performed. If you set this, and don't touch() the
file, the reloads don't happen. This can be a great boon in a
live environment:
PerlSetVar ReloadTouchFile /tmp/reload_modules
Now when you're happy with your changes, simply go to the
command line and type:
touch /tmp/reload_modules
And your modules will be magically reloaded on the next request.
This option works in both StatINC emulation mode and the
registered modules mode.
AUTHOR
Matt Sergeant, matt@sergeant.org
SEE ALSO
Apache::StatINC, Stonehenge::Reload
===
Subject: RE: [ANNOUNCE] Apache::Reload 0.04
From: Matt Sergeant <matt@sergeant.org>
Date: Wed, 30 Aug 2000 18:33:17 +0100 (BST)
On Wed, 30 Aug 2000, Douglas Wilson wrote:
> Forgive me if this is a stupid question, but I am rather
> ignorant in regards to mod_perl, and I'm curious about
> something.
>
> If you reload modules, does that increase the size of the
> forked children of the parent process? Or does just the
> parent reload, with the children having to die and respawn?
> Or do we care? :)
It increases the size - you lose shared memory. But only on modules that
actually get reloaded.
===
Subject: RE: [ANNOUNCE] Apache::Reload 0.04
From: Stas Bekman <stas@stason.org>
Date: Wed, 30 Aug 2000 21:20:56 +0200 (CEST)
On Wed, 30 Aug 2000, Matt Sergeant wrote:
> On Wed, 30 Aug 2000, Douglas Wilson wrote:
>
> > Forgive me if this is a stupid question, but I am rather
> > ignorant in regards to mod_perl, and I'm curious about
> > something.
> >
> > If you reload modules, does that increase the size of the
> > forked children of the parent process? Or does just the
> > parent reload, with the children having to die and respawn?
>
> It increases the size - you lose shared memory. But only on modules that
> actually get reloaded.
>
> > Or do we care? :)
We care a lot.
http://perl.apache.org/guide/performance.html#Sharing_Memory
But only in production. This module is used mostly for the development.
===