On 7 September 2010 00:24, virgil.balibanu <[email protected]> wrote:
> Would there be any significant difference between apache prefork and
> worker? The number of processes is fixed (they are all declared with
> WSGIDaemonProcess and with 15 threats each).
> If there is could you please explain a bit about it?

If all you are running is Django, ie., no PHP or other stuff on same
server, then use Apache worker MPM as it will mean less memory taken
up by Apache server child processes which are doing the proxying to
mod_wsgi daemon mode processes.

The number of processes/threads for Apache MPM is distinct from those
for mod_wsgi daemon processes. The number of threads across all Apache
 server child processes should be enough to cope with maximum number
of expected concurrent requests across all the sites hosted by the
mod_wsgi daemon processes which the Apache server child processes are
proxying it. Given that most mod_wsgi daemon processes are going to be
idle at any one time, that is obviously a lot less than the total
number of threads configured across all mod_wsgi daemon processes.

Also, for your situation, would even suggest that 15 threads is way
over the top for mod_wsgi daemon processes. You would possibly get
away with 3-5, thereby reducing a little bit your memory requirements.

Do be aware that mod_wsgi 3.X handles threads in daemon mode processes
a bit differently to mod_wsgi 2.X and earlier. If using mod_wsgi 2.X,
you will potentially use more memory to support the same number of
threads.

This is because in mod_wsgi 3.X threads in external thread pool are
only initialised as Python threads, and occur extra memory overhead as
a result, if their is sufficient concurrent requests to require them
to be activated. In mod_wsgi 2.X it simply round robbined between all
threads, even though it didn't actually need them to be all activated
at same time.

In other words, in mod_wsgi, most recently used thread is put back at
head of list of available threads and so subsequent request takes that
hot thread. Thus even though you have 15 threads, if never have more
than n concurrent requests, will only activate n+1 threads.

Graham

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to