Just noticed something with PythonAutoReload. It doesn't seem like it
can actually be turned off, unless I am missing the obvious. Can some
one validate this and prove I am not insane.
PythonAutoReload can be set to values of "On" or "Off". The value of
the option is reflected in table object returned by req.get_config().
For example, if PythonAutoReload is set to "On", this will be shown in
the config table as for example:
{'PythonDebug': '1', 'PythonAutoReload': '1', 'PythonInterpreter':
'testing'}
Note that the "On" gets converted to "1".
In the mod_python.apache code it uses code like:
module = import_module(module_name,
autoreload=int(config.get("PythonAutoReload", 1)), log=debug)
That is, if "PythonAutoReload" doesn't appear in the config table
object, it defaults to "1" and after the int() conversion, a boolean
truth value.
One might assume now that if PythonAutoReload is set to "Off" that
one would see the config table object show it with a value of "0".
This doesn't appear to be the case though, instead it doesn't appear
at all in the config table object if set to "Off". Ie., if I have:
PythonAutoReload Off
I am seeing the config table object contain:
{'PythonDebug': '1', 'PythonInterpreter': 'testing'}
If this is truly is correct and what I am seeing is how it is behaving,
then it is effectively impossible to turn auto reload off, as the lack
of the value in the config table object is going to indicate "On" and
not "Off" because of how the code uses the check:
config.get("PythonAutoReload", 1)
In case this is because of some subtle change made in Apache along the
way, am using:
Apache/2.0.55 (Unix) mod_python/3.2.6-dev-20051229 Python/2.3
When I get the time tomorrow I'll add extra debugging into mod_python.c
where it processes the PythonAutoReload directive to confirm when it
gets called and see what happens.
Anyway, thought I would point this one out. Have we been living under
the mistaken belief that auto reloading could actually be turned off?
FWIW, when I made it so I could actually turn off auto reload in my
experimental module reloading system, I could push through three times
as many requests per second in the complicated case I had. My
experimental module reloading system has more overhead that the one
mod_python uses now, but even so, if it really is the case that auto
reload can't be turned off now, when it can, could make some sites
perform a somewhat better. :-)
Graham