3 ms·
While a request itself can finish reasonably fast in a slow language, the amount of resources a single request consumes since python can't do multithreading is
by matsemann 5y ago
While a request itself can finish reasonably fast in a slow language, the amount of resources a single request consumes since python can't do multithreading is quite absurd. The python codebases I've worked on need an order of magnitude more servers to handle similar amount of loads, since each request is basically handled by a separate process.
- _hl_ 5y agoIt's fairly standard practice to hack in some "green thread" behaviour using gevent or similar. It's far from perfect but gets you away from the single-process-per-request bottleneck. If it even is much of a bottleneck in the first place - isolating each request in its own process worked well enough back in the CGI days. I suspect the real reason is that autoscaling doesn't generally play well with having thousands of mostly idle processes.