miyagawa / Starman

Starman is a high-performance preforking Perl PSGI web server
http://search.cpan.org/dist/Starman
Other
287 stars 84 forks source link

Starman in Production #123

Closed billmoseley closed 8 years ago

billmoseley commented 8 years ago

I'm testing a Catalyst app with Starman (and Server::Starter) for production use. I'm wondering how best to monitor, and tune, the cluster.

Before we were using Apache/mod_perl with pre-fork. Looking at the number of web processes was a useful metric. For example, Apache would spawn processes as request load increased. Also, if backend processes (e.g. database) slowed down the number of Apache child processes increased quickly.

Starman has a fixed number of workers, so cannot use worker growth as a metric.

Any suggestions on how best to tune the number of Starman workers on a machine? And likewise, how to size a cluster? E.g. track what percent of the cluster workers are idle?

FWIW, I've currently got eight VMs sitting behind an F5, each running 20 workers. The VMs report 15GB and 4 cores.

I've been using Apache Benchmark and httperf to do some limited stress testing.

lestrrat commented 8 years ago

At a previous shop we monitored usage using https://metacpan.org/pod/Plack::Middleware::ServerStatus::Lite, and periodically fed its results to a monitoring tool.

billmoseley commented 8 years ago

Thanks @lestrrat.