Hmmm, even 10000 hits per day is not a large site.
For that would just not bother setting processes or threads and just
let WSGIDaemonProcess default to single process with 15 threads. That
should be more than adequate.
Do note that technically setting 'processes=1' is not the same as not
setting the option. When you use 'processes' option for
WSGIDaemonProcess, even if a single process, the wsgi.multiprocess
flag in WSGI environment is set to True.
Thus, don't say 'processes=1', allow it to be defaulted to 1 instead.
The only time you would want 'processes=1' is if you are running a
cluster of machines and application is spread across them yet only
running single process on each. In this case there are actually
multiple process, just distributed and need way to flag that.
Graham
Yeah, that's why I said "larger" to keep it relative. But doing the
math and averaging out hits evenly, that's 1 request every 11 seconds
or so... definitely not large at all.
> For that would just not bother setting processes or threads and just
> let WSGIDaemonProcess default to single process with 15 threads. That
> should be more than adequate.
OK. After doing that on my slicehost account, it looks like it
actually reduced memory compared to what I had previously, so that's a
nice side effect when I'm always looking at how far away the 256M
limit is. Previously I think I was using 2 processes and 1 thread...
no idea where I got that idea from. I think I had it in my mind that
Django shouldn't be run multithreaded, which might have been true at
one point but is no longer true today.
Thanks Graham,
Rob
The defaults for standard Apache source distribution are:
# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
This is a reasonable starting point.
This allows for a lot more concurrent connections, but if you are also
serving static files and default of keepalive being on is still in
use, the maximum of 150 clients is okay, especially since it will only
create more than 2 Apache child worker processes if it really needs
to.
I would only bother starting to fiddle with the defaults when you have
realistic estimates of the sort of load you would need to handle.
Graham