Hot-deploying Plack applications using Server::Starter
It's time to eat my own dog food.
During YAPC::Asia 2009, I wrote a tiny module called Server::Starter, a superdaemon for hot-deploying TCP servers (see Writing Hot-deployable servers (introduction of Server::Starter) for the benefits of using the module). On the other hand, I have been involved in developing the http servers in Plack since then.
And time has come. Having decided to use the two in my new web application server, I wrote a module to glue them together, Kazuho Oku / Plack-Server-Standalone-Prefork-Server-Starter - search.cpan.org.
Although the name is pretty long, it is easy to use :-p
// start server
# start_server --port=80 -- plackup -s Standalone::Prefork::Server::Starter myapp.psgi
// or use setuidgid to drop privileges
# start_server --port=80 -- setuidgid www plackup -s Standalone::Prefork::Server::Starter myapp.psgi
// graceful update
# killall -HUP start_server
Or use svc -h if you are going to manage Server::Starter using daemontools.
Comments