> On 21 Dec 2015, at 11:30 PM, Jordi <[email protected]> wrote:
>
> Dear,
>
> I have a question regarding the use of WSGI in daemon mode with Apache in
> worker mode.
>
> If Apache is only used for forwarding requests to WSGI (ie no static files),
> are the workers configuration parameters of Apache any important? I'm
> referring to these:
> StartServers 10
> MaxClients 250
> MinSpareThreads 25
> MaxSpareThreads 250
> ThreadsPerChild 25
> MaxRequestsPerChild 0
>
> This is the WSGI configuration:
> WSGIRestrictEmbedded On
> WSGIPythonOptimize 1
> WSGIDaemonProcess main group=www-data user=www-data processes=2 threads=5
> lang='en_US.UTF-8' locale='en_US.UTF-8'
> python-path=/data/web/app:/data/web/app/addons
> WSGIDaemonProcess admin group=www-data user=www-data processes=1 threads=2
> inactivity-timeout=300 lang='en_US.UTF-8' locale='en_US.UTF-8'
> python-path=/data/web/app:/data/web/app/addons
>
> If they matter, should I just put them to be in the same line of the WSGI
> values?
>
> PS: what is a good way to start with these values? I find it very confusing.
> The server is a typical 1 core 2.5 GHz cloud server. Memory is not an issue
> for this application. I guess at some point the processes/threads get limited
> by CPU or I/O if disk access is required.
Have a watch of:
http://lanyrd.com/2013/pycon/scdyzk/#link-qmqc
<http://lanyrd.com/2013/pycon/scdyzk/#link-qmqc>
if you haven’t already.
As to whether MPM settings should match capacity for daemon processes, the
answer is no.
Your case is complicated a little by spreading across two daemon process
groups, but it should be like a funnel, with a bit more capacity in the MPM
workers than daemon processes.
This is to facilitate a bit of queuing, but also because the MPM workers will
be handling static file requests as well.
In mod_wsgi-express where it is dynamically calculate how many MPM workers
there are, I run it at a ratio of 1.5, although I have a floor on that as well
so that the minimum doesn’t go below a certain level even if number of
processes/threads in daemon mode is very low.
Anyway, overall it is a bit hard to give concrete guidance as I know nothing
about your traffic volumes.
Unless you have a lot of static file serving going on, right now you appear to
have much too high a ratio than you possible need.
You have capacity of 250 in MPM workers, but in daemon processes they can at
most handle 13 concurrent requests. So you have a ratio of almost 20.
So how much traffic do you actually get?
Graham
--
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.