Skip to content

Instantly share code, notes, and snippets.

@miyagawa
Created May 26, 2011 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save miyagawa/993824 to your computer and use it in GitHub Desktop.
Save miyagawa/993824 to your computer and use it in GitHub Desktop.
HTTP vs FastCGI quick comparision
HTTP
Pros:
HTTP, easy to debug
Also works directly behind load-balancers (without frontends)
Many PSGI server implementations, preforking Starman, Starlet and non-blocking Twiggy
Cons:
Need to configure X-Forwarded-* headers both on fronend and backend
Keep-alive can be problematic to starve workers (e.g. mod_proxy + mpm_prefork)
FastCGI:
Pros:
Potentially faster protocol because of binary
Sysadmin friendly (errors usually go to the web server's logs)
Cons:
No major server supports persisten FastCGI connections
Needs some tweaks to pass SCRIPT_NAME etc. correctly in nginx/lighttpd
Many broken web server implementations such as mod_fcgid or earlier version of lighttpd
FCGI.pm requires C/XS, FCGI::ProcManager options are confusing (hence fastpass and Net::FastCGI)
Less backend implementations, especially the one with proper preforking and non-blocking options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment