Grokking Concurrency in Python
0% completed
Sizing a Service
Suppose each request to a service waits 40 milliseconds for a database and then spends 10 milliseconds running Python code. One thread finishes 20 requests per second, so sixteen threads might be expected to finish 320. On the standard build they cannot. The 10 milliseconds of Python code needs the process's one GIL, so one process can run at most 1,000 / 10 = 100 requests per second, however many threads it has.
Three numbers set a service's capacity: how many processes it runs, how many threads each process has, and how many requests arrive at the same time
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%