3 ms·
Long running processes only need to load their imports, configuration, database connections, etc. once, and don't incur overhead for each request. On top of thi
by thewataccount 3y ago
Long running processes only need to load their imports, configuration, database connections, etc. once, and don't incur overhead for each request. On top of this, things like imports get to be cached, and there's less need for a database connection pooler to broker connections.
Particularly async runtimes have become more popular - where you can have a single process handling concurrent requests and awaiting/yielding in between their api/db calls. Instead of having many processes that don't share resources that might be waiting 10ms/100ms for api/db calls.
For applications that make large numbers of api/db calls - especially slower ones, may prefer async runtimes over individual processes per request.
I'm not at all saying CGI is a bad option, just that there are real benefits to reusing, pooling and caching resources.