Fast CGI protocol
18 May 2025 (Updated 18 May 2025)
What is FastCGI?
FastCGI is a more-efficient evolution of the CGI protocol, which means it is also a protocol that defines how web servers like Nginx or Apache should interface with external scripts or programs (PHP, Python, Perl, etc) to generate dynamic web content.
The main difference between FastCGI and CGI is in how the web server like Nginx executes external scripts:
Feature | CGI | FastCGI |
---|---|---|
Process model | Starts a new process per request | Reuses long-running persistent processes |
Performance | Slow (lots of process creation) | Fast (no need to re-launch process) |
Resource usage | High | Low |
Still used? | Rarely | Common (especially with PHP-FPM) |
Tagged:
Misc