FastCGI

CGI

“one new process per request” model makes CGI programs very simple to implement, but limits efficiency and scalability.

FastCGI

1990년대 중반 Mark Brown이 Open Market(보스턴의 eCommerce 스타트업이었음) 재직시 개발. 원래 NSAPI 대응. 이즈음 Apache 모듈이 등장하며 mod_perl, mod_php 등과 경쟁.

httpd.conf에서 mod_php 설정 예제:

LoadModule php_module /usr/local/opt/php/lib/httpd/modules/libphp.so

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

그러나 FastCGI는 별도 프로세스에서 항상 구동되며 일종의 WAS처럼 동작한다.

How to connect to PHP-FPM directly

$ brew install php fcgi

리눅스와 달리 맥에서는 저기에 php-fpmcgi-fcgi가 모두 설치된다. www 디렉토리에서 php-fpm 실행 후,

$ SCRIPT_FILENAME=index.php \
REQUEST_METHOD=GET \
cgi-fcgi -bind -connect 127.0.0.1:9000

CLI에서 FastCGI 동작 여부를 확인할 수 있다.

Debian 계열에서는 apt-get install libfcgi0ldbl으로 가능하다고 하나 테스트 해보지 않음. CentOS 계열(Amazon Linux 2 포함)에서는 yum에서 패키지를 찾을 수 없었다.

SCGI

a fast and simple interface between web servers and application servers(similar to FastCGI). It is similar to FastCGI but is designed to be easier to implement.

그러나 SCGI는 거의 쓰이지 않는것 같다.

WSGI

WSGI is the Web Server Gateway Interface. It is a specification that describes how a web server communicates with web applications, and how web applications can be chained together to process one request. WSGI is a Python standard described in detail in PEP 3333 in 2003.

SCGI is a language-neutral means of connecting a front-end web server and a web application. WSGI is a Python-specific interface standard for web applications.

WSGI 구현으로 uWSGI와 Gunicorn등이 있다.

AJP

AJP (Apache JServ Protocol) seems to be a simple and fast binary protocol, which makes it play in the same area as FastCGI, and has functionality similar to WSGI.

It is used in Tomcat, Jetty, and more.

Last Modified: 2022/01/30 01:54:47

is a collection of Papers I have written.
© 2000 - Sang-Kil Park Except where otherwise noted, content on this site is licensed under a CC BY 4.0.
This site design was brought from Distill.