5 ms·
It's not just the start-up and shut-down costs. A CGI process might need to attain connections to databases or other resources that could be pooled and re-used
by jim_lawless 5y ago
It's not just the start-up and shut-down costs. A CGI process might need to attain connections to databases or other resources that could be pooled and re-used if the process didn't completely terminate.
You might want to look at using FastCGI:
https://en.wikipedia.org/wiki/FastCGI https://en.wikipedia.org/wiki/FastCGI
Basically, the CGI processes stay alive and the servers supporting FastCGI ( like Apache and nginx ) communicate with an existing FastCGI process that's waiting for more work, if available.
- harryvederci 5y agoThanks! That's a good point, about re-using connections. For my current use-case* that wouldn't be an issue, so CGI could probably be OK there, then! * A side project that uses SQLite (1 file per user), and no other external resources.