Apache Mod-Python - Closed: (MODPYTHON-10) Continual reloading of modules

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > March 2006 > Closed: (MODPYTHON-10) Continual reloading of modules





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Closed: (MODPYTHON-10) Continual reloading of modules
Graham Dumpleton (JIRA)

2006-03-05, 2:45 am

[ http://issues.apache.org/jira/brows...HON-10?page=all ]

Graham Dumpleton closed MODPYTHON-10:
-------------------------------------


> Continual reloading of modules
> ------------------------------
>
> Key: MODPYTHON-10
> URL: http://issues.apache.org/jira/browse/MODPYTHON-10
> Project: mod_python
> Type: Bug
> Versions: 3.1.3
> Reporter: Graham Dumpleton
> Priority: Minor
> Fix For: 3.2.7


>
> From mailing list post.
> Continual reloading of modules
> ------------------------------
> Create a subdirectory called "publisher". In that directory create a
> ".htaccess" file containing:
> SetHandler python-program
> PythonHandler mod_python.publisher
> PythonDebug On
> Now create two subdirectories "subdir-1" and "subdir-1". In both of these
> subdirectories create an "index.py" file which contains:
> import os
> def index():
> return os.getpid(),__file__
> Restart Apache to clear any cached modules and then cycle between the URLs
> corresponding to the two subdirectories. In my case this is:
> /~grahamd/publisher/subdir-1
> /~grahamd/publisher/subdir-2
> /~grahamd/publisher/subdir-1
> /~grahamd/publisher/subdir-2
> ...
> The output for each page was in turn:
> (462, '/Users/grahamd/Sites/publisher/subdir-1/index.py')
> (462, '/Users/grahamd/Sites/publisher/subdir-2/index.py')
> (462, '/Users/grahamd/Sites/publisher/subdir-1/index.pyc')
> (462, '/Users/grahamd/Sites/publisher/subdir-2/index.pyc')
> ...
> If you look at the Apache error log file you will see something like:
> [Tue Jan 25 09:03:45 2005] [notice] mod_python: Creating 32 session mutexes
> based on 4 max processes and 25 max threads.
> [Tue Jan 25 09:03:45 2005] [notice] Apache/2.0.51 (Unix) mod_python/3.1.3
> Python/2.3 configured -- resuming normal operations
> [Tue Jan 25 09:04:02 2005] [notice] mod_python: (Re)importing module
> 'mod_python.publisher'
> [Tue Jan 25 09:04:02 2005] [notice] mod_python: (Re)importing module 'index'
> with path set to '['/Users/grahamd/Sites/publisher/subdir-1']'
> [Tue Jan 25 09:04:16 2005] [notice] mod_python: (Re)importing module 'index'
> with path set to '['/Users/grahamd/Sites/publisher/subdir-2']'
> [Tue Jan 25 09:04:26 2005] [notice] mod_python: (Re)importing module 'index'
> with path set to '['/Users/grahamd/Sites/publisher/subdir-1']'
> [Tue Jan 25 09:04:40 2005] [notice] mod_python: (Re)importing module 'index'
> with path set to '['/Users/grahamd/Sites/publisher/subdir-2']'
> You will see how as one cycles between the two URLs corresponding to the
> modules, that the modules are reimported everytime.
> Note that I ensured that only one Apache server process was initially
> started so that all requests served by same process. One can also see this
> is the response, which includes the process ID of the server process.
> Overall what is returned is correct, but it isn't efficient because each
> request is triggering a module import.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com