SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
PyCon HK 2015 - Monitoring the performance of python web applications
33.
I/O vs CPU
• I/O bound request handlers.
• Okay to use multiple threads.
• CPU bound request handlers.
• Better to use multiple processes.
• Restrict processes to single threads, or at most
two if requests have very short response time.
34.
I/O and CPU
• Use no more than 3 to 5 threads per process.
• Use a small number of processes.
• Watch the CPU utilisation of processes.
• Be prepared to scale out to more hosts.
35.
Partitioning
Proxy
CPU
I/O
CPU
Multiple threads.
Single threaded.
Multiple processes./cpu-tasks
/io-tasks