Closed: (MODPYTHON-10) Continual reloading of modules
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Closed: (MODPYTHON-10) Continual reloading of modules




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-05-06 07: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 sess
ion mutexes
>   based on 4 max processes and 25 max threads.
>   [Tue Jan 25 09:03:45 2005] [notice] Apache/2.0.51 (Unix) mod_pyt
hon/3.1.3
>   Python/2.3 configured -- resuming normal operations
>   [Tue Jan 25 09:04:02 2005] [notice] mod_python: (Re)importing mo
dule
>   'mod_python.publisher'
>   [Tue Jan 25 09:04:02 2005] [notice] mod_python: (Re)importing mo
dule 'index'
>   with path set to '['/Users/grahamd/Sites/publisher/subdir-1']'
>   [Tue Jan 25 09:04:16 2005] [notice] mod_python: (Re)importing mo
dule 'index'
>   with path set to '['/Users/grahamd/Sites/publisher/subdir-2']'
>   [Tue Jan 25 09:04:26 2005] [notice] mod_python: (Re)importing mo
dule 'index'
>   with path set to '['/Users/grahamd/Sites/publisher/subdir-1']'
>   [Tue Jan 25 09:04:40 2005] [notice] mod_python: (Re)importing mo
dule '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.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:10 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register