3 ms·
Many things we’ve dispensed with long ago seem to be forgotten and the younger coders are learning for themselves the hard way. Aka the same way we did.
by CodeWriter23 7y ago
Many things we’ve dispensed with long ago seem to be forgotten and the younger coders are learning for themselves the hard way. Aka the same way we did.
- badrabbit 7y agoExcept with a lot of learned lessons applied.
- oap_bram 7y agoOne of the things I'm wondering however: How popular is CGI if I don't find it with the query "run script on nginx location directive".
- westurner 7y agoNginx probably somewhat-deliberately has FastCGI but not regular CGI for a number of reasons. CGI has process-per-request overhead. CGI typically runs processes as the user the webserver is running as; said processes can generally read and write to the unsandboxed address space of the calling process (such as x.509 private certs). Just about any app can be (D)DOS'd. That requires less resources with the process-per-request overhead of CGI. In order to prevent resource exhaustion due to e.g someone benignly hitting reload a bunch of times and thus creating multiple GET requests, applications should enqueue task messages which a limited number of workers retrieve from a (durable) FIFO or priority queue and update the status of. Websockets may or may not scale better than long-polling for streaming stdout to a client.
- oap_bram 7y agoInteresting and really informative! Thanks for sharing!
- minhoryang 7y agonginx is not for CGI that's why no result showed. CGI was popular at 1990-early 2000. Even apm(apache php mysql) relied on CGI between apache and php.
- icedchai 7y agoWhen using Apache, PHP was mostly commonly deployed as an Apache module (mod_php.) Almost nobody ran it as CGI unless they had no other choice. mod_php felt very, very fast compared to alternatives. I remember doing "custom compiles" for a number of local early web host / Internet providers because their admins didn't want to build C code.