Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why are the default # of processes and threads set to 1 and 15, respectively? #308

Closed
GoogleCodeExporter opened this issue Oct 3, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

This is not really a defect in the program, but rather an open question as to 
the logic behind the default values.

Given that CPython doesn't scale as well across threads as it does across 
processes and mod_wsgi is linked to CPython, why is the default 1 process and 
15 threads? 15 processes and 1 thread would surely make more sense. 

Think of all the poor developers who don't understand the performance 
implications of the GIL and they want their application to "just work".

Original issue reported on code.google.com by meha...@gmail.com on 7 Oct 2013 at 5:19

@GoogleCodeExporter
Copy link
Author

If nothing else, the documentation on this page could suggest some reasonable 
defaults for a typical Python web application:

https://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines

Original comment by meha...@gmail.com on 7 Oct 2013 at 5:21

@GoogleCodeExporter
Copy link
Author

Please note that the mailing list is a better forum for discussion.

http://code.google.com/p/modwsgi/wiki/WhereToGetHelp?tm=6#Asking_Your_Questions

Because web applications are normally I/O bound, the GIL is not the big problem 
people think it is and multithreading tends to be more than adequate. 
Multiprocessing only becomes more important when you are talking about CPU 
bound activities.

More important in web applications is usually memory usage and using single 
threading and many processes will use a lot lot more memory. This will often 
exhaust a users system memory long before they reach any performance issue due 
to the use of threading.

So overall the safer option for the typical user is a single process with 
multiple threads.

As to reasonable defaults, that is an impossible question to answer as it 
depends on your specific web application. There is no one right way.

I would suggest you go watch my talks:

http://lanyrd.com/2012/pycon/spcdg/
http://lanyrd.com/2013/pycon/scdyzk/

Original comment by Graham.Dumpleton@gmail.com on 8 Oct 2013 at 5:42

@GoogleCodeExporter
Copy link
Author

OK, well thanks for the reply. I agree that "reasonable defaults" is 
subjective, and I will check out the talks. Thanks again.

Original comment by meha...@gmail.com on 11 Oct 2013 at 6:55

@GoogleCodeExporter
Copy link
Author

Closing out documentation issues. Will pick up another time on github side when 
get enough momentum to work on documentation again.

Original comment by Graham.Dumpleton@gmail.com on 12 Nov 2014 at 11:03

  • Changed state: WontFix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant