Tatsuhiko Miyagawa's Blog

PSGI standalone web servers

March 26, 2010

Now we have 4 (or actually more) PSGI standalone web servers. Here’s a quick cheat sheet to compare them:

  • HTTP::Server::PSGI - core in Plack. Should work on all systems with perl 5.8.1 or later. No preforking nor keep-alives. Best for the quick development with plackup and testing with Plack::Test.
  • HTTP::Server::Simple::PSGI - only dependent on HTTP::Server::Simple which is absolute core-only and should work back to perl 5.6. Best to write PSGI embedded web server application even without Plack.
  • Starman - High performance preforking web server with HTTP/1.1 and UNIX domain socket support. it’s based on Andy Grundma’s Catalyst::Engine::HTTP::Prefork, and works exactly like Rack’s Unicorn. nginx’s best friend.
  • Starlet - HTTP::Server::PSGI + Server::Starter + Parallel::Prefork. Much simpler than Starman and less features, best to run behind proxy.

Personally I recommend Starman for the production use, running it behind nginx, Varnish or lighttpd. Starlet would be great if you don’t need Starman’s fancy features like dynamic server pool configuration or HTTP/1.1 support, and if you’re a big fan of Kazuho Oku’s software, which I myself am :)

All of them have Plack adapters so you can change the backend easily with plackup -s Starman etc. to test your application in your system.