> Yes it was different subinterpreters. When I added WSGIApplicationGroup > directive, it works fine.
That doesn't make any sense as the configuration you quote below for WSGIScriptAlias shouldn't result in separate sub interpreters being created. Can you provide the output from the test where it shows that different sub interpreters were used. http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Sub_Interpreter_Being_Used and give the URLs used in each case. Graham > On 18/06/2014, at 12:05 AM, [email protected] wrote: > >> >> >> On Monday, June 16, 2014 5:04:38 PM UTC-5, Graham Dumpleton wrote: >> A few things can be happening. >> >> 1. You are in fact using daemon mode but you are changing the WSGI script >> file between requests, which will cause mod_wsgi to kill and restart the >> daemon process and so reload your code. >> >> http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode >> >> >> Yes I am using daemon mode. Sorry for not mentioning it. >> No, I do not change the script between requests. >> >> 2. You are in fact using daemon mode and you have set maximum-requests, >> inactivity-timeout or some other option which would cause the daemon process >> to be killed and restarted based on some condition. >> >> No. I do not run out of requests maximum. Reproduce this by running 2 >> requests: 1st one initializes the script and second one re-loads it. >> >> >> 3. You have not got your configuration correct and are not actually >> delegating the WSGI application to run in the daemon process group. For >> example,e missing WSGIProcessGroup directive to match WSGIDaemonProcess, and >> so you are running in multiprocess embedded mode configuration instead. >> >> This is not the case. I pring os.getpid() output and can confirm that my >> script is executed by the correct process. >> >> >> http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Embedded_Or_Daemon_Mode >> >> 4. You have not got your configuration correct and have used a wildcard in >> conjunction with WSGIScriptAlias which is triggering a case where every >> distinct URL is using a different sub interpreter. >> >> No, this is not the case. Here is my configuration: >> >> WSGIDaemonProcess wsgi_demo_app threads=1 display-name=%{GROUP} >> python-path=/home/ivm/wsgi:/home/ivm/build/wsgi_py >> >> WSGIScriptAlias /wsgi/demo /home/ivm/wsgi/WSGIDemoApp.py >> >> >> >> <Location /wsgi/demo> >> >> WSGIProcessGroup wsgi_demo_app >> >> </Location> >> >> >> >> http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Sub_Interpreter_Being_Used >> >> So I would suggest you run the test to see whether you are using daemon mode >> or not and also post your configuration here so can verify that it has been >> done correctly. >> >> Graham >> >> On 17/06/2014, at 6:41 AM, [email protected] wrote: >> >>> Hello. >>> >>> I am trying to share data in memory between invocations of my request >>> handler. >>> I assume that a module gets imported only once per lifetime of the >>> application and mod_wsgi does not re-import the module for next request. >>> >>> So basically, I am writing something like this: >>> >>> class X: >>> ... >>> >>> XX = X() >>> >>> def application(environ, start_response): >>> ... >>> XX.method() >>> ... >>> >>> and my assumption is that XX and its attributes survive unchanged between >>> requests. >>> >>> I have threads=1 and omit "processes" argument, which is equivalent to >>> processes=1 >>> >>> I found that this is not always true. What I am seeing is that the module >>> gets re-imported pretty consistently if I access my server from some other >>> client. >>> >>> In other words, as long as I access my server from the same browser or >>> repeat the same wget command from the same computer, I reach the same XX >>> object. But if I switch to certain other way to access the page, I see that >>> the module is re-imported and the object is re-created. >>> >>> Can someone explain this please ? >>> >>> Thanks. >>> >>> >>> >>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "modwsgi" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at http://groups.google.com/group/modwsgi. >>> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/d/optout.
