When using mod_wsgi-express it does run daemon mode. So with that configuration
you should have two persistent processes. The processes should not be recycled
under normal circumstances.
The only way with the default configuration that processes could be recycled is
if you have stuck requests and eventually trip the request timeout. For a multi
thread process the process restart would kick in only when the length of all
active requests (across total number of request slots) averaged 60 seconds.
So if you had one stuck request only, if it was stuck for 5 minutes, then
finally process would be forcibly restarted. If has two stuck requests that
started at same time, would restart after 2.5 minutes. If five stuck requests
in same process, then after 60 seconds. It is a weird calculation but only
thing that makes half sense in multi threaded application.
To work out whether forced process restarts are occurring because of the
timeout, add the:
—log-level info
option. With this mod_wsgi will log more details about process restarts and why
they were triggered. You can then look in the logs to confirm if this is what
is happening.
Do you know if you are seeing requests that never seem to finish? Or does your
application run with very long requests on purpose?
Graham
> On 19 Apr 2016, at 6:34 PM, Julien Delafontaine <[email protected]> wrote:
>
> I am using mod_wsgi-express:
>
> mod_wsgi-express setup-server ${baseDir}/project/wsgi.py --port=8887
> --user myapp --server-root=${remoteDir}/mod_wsgi-server --processes 2
> --threads 5;
>
> Then
>
> ${remoteDir}/mod_wsgi-server/apachectl restart
>
> This sets up the configuration itself, it seems. I thought mod_wsgi-express
> would run daemon mode by default?
>
>
> Le mardi 19 avril 2016 10:19:01 UTC+2, Graham Dumpleton a écrit :
> Sounds like you are using embedded mode rather than daemon mode. In embedded
> mode Apache will recycle processes.
>
> How do you have it configured? Are you using
> WSGIDaemonProcess/WSGIProcessGroup directives at all?
>
> Graham
>
>> On 19 Apr 2016, at 6:12 PM, Julien Delafontaine <[email protected]
>> <javascript:>> wrote:
>>
>> Hello,
>>
>> I have a multi-processes mod_wsgi application that stores some cache data in
>> memory. Each process naturally gets its own instance of that cache. Now it
>> seems that processes after some time get killed/restarted/whatever, so that
>> the cache has to be reinitialized everytime this happens. How can I control
>> it ?
>>
>> Ideally I'd like to start 2 Apache/mod_wsgi processes, initialize the cache
>> on each, and let the app run forever without needing to recompute the cache.
>> Is that possible?
>>
>> --
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] <javascript:>.
>> Visit this group at https://groups.google.com/group/modwsgi
>> <https://groups.google.com/group/modwsgi>.
>> For more options, visit https://groups.google.com/d/optout
>> <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]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/modwsgi
> <https://groups.google.com/group/modwsgi>.
> For more options, visit https://groups.google.com/d/optout
> <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 https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.