Perl ウェブ開発の中世〜CGI と Plack の間〜

Preview:

Citation preview

Perl CGI Plack

OGATA Tetsuji (@xtetsuji) 2017/03/04 YAPC::Kansai 2017 OSAKA

https://flic.kr/p/K9v8rD

• OGATA Tetsuji (@xtetsuji)

• http://post.tetsuji.jp/

• Gaiax R&D INFRA

https://flic.kr/p/bhrKfp

• 🔈CGI Plack Perl

• 🔈

• 🔇

• 🔇

CGI

https://flic.kr/p/aWg7jz

• 1991 HTTP HTML

• 1993 NCSA HTTPd CGI

• 1995 Windows 95

• 1999 NTT i-mode

Photo:

• 1990 CGI

• CGI

URL CGI

CGI

URL CGI

CGI

• CGI

• 1

• Perl CGI

• 1

CGI Perl

CGI

• C

• 20 21 CGI Perl

CGI Perl• 1990 ISP(Internet Service Provider)

ISP

• Perl

CGI Perl

• ISP Perl CGI

• CGI Perl

• IT CGI Perl

CGI Perl 2000 2008

https://flic.kr/p/5kwk72

• CGI

• CGI

• 2000 2003

https://flic.kr/p/9xG4TJ

Apache mod_perl (1997 )

• mod_perl Apache Perl Apache

• Apache C

• Apache Perl CGI Perl

Apache mod_perl (1997 )

• 2000

• mod_perl Web (by miyagawa -san @ 2001 YARPC 19101 LT)

• mod_perl C10K Problem (by takesako -san @ 2004 Linux )

FastCGI (mid-1990s )

• CGI FastCGI CGI

• FastCGI

FastCGI (mid-1990s )

• Apache mod_fcgi FastCGI

• Perl FCGI

• Apache

SpeedyCGI (1999 )• FastCGI

Perl SpeedyCGI

• CGI Perl Common

• CGI shebang #!/usr/bin/perl #!/usr/bin/speedy

CGI mod_perl FastCGI SpeedyCGI

Apache

Apache

RFC

Apache APIFastCGI

Specification

Perl ※

Perl

1991 1996 1990 1999

Perl CGI• 2007 2008 YAPC::Asia Tokyo

mod_perl FastCGI

• Catalyst WAF (Web Application Framework)

mod_perl FastCGI

• PSGI / Plack (2009)

mod_perl and FastCGI

• CGI Plack 2

• WAF FastCGI

• Perl Apache mod_perl

• FastCGI 2017mod_perl

mod_perl and FastCGI

• FastCGI

• mod_perl

• mod_perl Apache (prefork)

• FastCGI mod_perl

mod_perl

• Apache lighttpd Nginx

• Apache 1 2 Apache API mod_perl

• mod_perl

Perl

• Java Servlet e.g. Tomcat

• IIS/ASP

• mod_perl e.g. mod_ruby mod_python

• PHP e.g. mod_php php-fpm(FastCGI)

• Ruby on Rails Passenger Unicorn…

https://flic.kr/p/bVwF8R

prefork

I/O

Perl Apache (prefork)Starlet, Starman

NginxTwiggy

• Apache MPM (Multi Processing Module) prefork

(event) (worker)

• Perl prefork

prefork

$ ps auxwf

• fork =

• root

• prefork = fork

prefork

prefork

Parent

prefork

Parent

Child Child Child Child

Process fork

prefork

Parent

Child Child Child Child

Process fork

HTTP

event

event

Master

event

Master

Worker

event

Master

Worker

Worker

HTTP

PSGI / Plack 2009

https://flic.kr/p/726NSK

• Catalyst WAF (Web Application Framework)

mod_perl FastCGI

• CGI mod_perl FastCGI SpeedyCGI WAF

• WAF WAF

• Python WSGI (Web Server Gateway Interface) Ruby Rack

• CGI FastCGI

PSGI Plack

• CGI WSGI

• WSGI PSGI (Perl Server Gateway Inteface) Plack

https://flic.kr/p/7n8y6p

https://flic.kr/p/7n8y6p

https://flic.kr/p/7n8y6p

https://flic.kr/p/7n8y6p

https://flic.kr/p/7n8y6p

https://flic.kr/p/7n8y6p

PSGI

• CGI WAF PSGI

• Perl

Plack

• PSGI

• PSGI PSGI

• PSGI Plack

Plack

• Plack::Handler::

• PSGI Plack::Middleware::

PSGI / Plack WAF

http://www.kirin.co.jp/company/news/2016/0727_05.html

🍻

http://www.kirin.co.jp/company/news/2016/0727_05.html

2017

https://flic.kr/p/mzF5vS

• Perl PSGI WAF Plack

• WAF Mojolicious

Amon2

• Plack::Handler::

• WAF PSGI …

• mod_perl

https://flic.kr/p/5i9taP

https://flic.kr/p/5i9taP

Recommended