PSGI/Plack: Now we feel like writing real web servers!
Continuous hacking!
Daisuke Murase made FastCGI backend for Plack!
I noticed some issues with PATH_INFO tests when testing with FastCGI and lighttpd. So here’s my investigation how they handle them differently. It’s a mess. More contributions welcome.
We did some benchmarking with running Catalyst natively with Catalyst::Engine::Apache2 and with Catalyst::Engine::PSGI + Plack::Impl::Apache2. The benchmark shows the number is roughly the same, which proves that PSGI decoupling and abstraction doesn’t slow things down, and of course, could be optimized further because of this low level nature, which is awesome.
Randy J. Ray is blogging about HTTP parsers with Perl (and XS).
Kazuho’s been working on adding keep-alive support to the standalone server: the apache bench now shows 4000 req/s with -k option! He is now working on the standalone prefork server.
We’ve found bugs and made patches against IO::AIO to support sendfile(2) in FreeBSD and Mac OS X.
Kazuho pointed out that Impl::Standalone and Impl::AnyEvent code might have a problem with bigger file (like ~2MB) and voila! We added that to the unit tests and it revealed a bug, which was immediately fixed.
tokuhirom made FastCGI protocol client in pure perl. This might not really matter in PSGI/Plack frameworks but would be useful to test our server side implementations, as well as implementing FastCGI connector for perlbal.
Yappo pointed out benchmarking Hello World running on HTTP::Engine::Interface::ServerSimple and Hello World running on Plack::Impl::ServerSimple show almost the same result. It seems true, so “HTTP::Engine is slow because of Request/Response objects creation” feels like a myth. HTTP::Engine is still slower than the native Hello World raw PSGI app, but the overhead doesn’t really matter when your web application takes more than 0.01s to serve your page.
I made Sledge::Pages::PSGI plugin to turn your Sledge web app to run on top of PSGI stack for my friends who use the web application framework I wrote 7 years ago :) You need a patched CGI.pm from my fork.
We’ll show more numbers once everything gets stable, but so far the number seems promising and very interesting. Simple Hello World is now 4000 req/s with Standalone server with keep-alive on, and 2MB photo file serving runs fastest on AnyEvent server (300 req/s) with sendfile(2) and AIO enabled while other dumb implementation suffers from I/O in the perl land like (80 req/s).