On Thu, 30 May 2013 15:56:45 +0900 hommura hiroaki <hommura_hiroaki@outlook.com> wrote:
Hi all, Why dancer on starman becomes very slow? Am I doing something wrong? #### directly starman$ cat app.psgimy $app = sub { return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello World' ] ];};$ starman &$ ab gives me 4000 reqs/second #### directly dancer$ cat app.pl#!/usr/bin/env perluse Dancer;get '/' => sub { "Hello World!" };dance; $ perl app.pl &$ ab gives me 600 reqs/second #### dancer on starman$ starman app.pl &$ ab still gives me 600 reqs/second Why so slow?Is it possible let dancer deal with HTML request, and starman deal with non-HTML request directly?
Yeah, Dancer will be slower than a bare-bones PSGI app, as, well, it's giving you a lot of features, which don't come free. 600 req/sec is still pretty fast, I'd say :) I think what you're asking for is to prevent static requests (images, stylesheets etc) reaching Dancer, which is sensible; I tend to have my Dancer apps proxied behind nginx, and configure nginx to serve up the static stuff for me, so those requests never hit the Dancer app. Pretty sure there's an example of that in the deployment docs. Cheers Dave P -- David Precious ("bigpresh") <davidp@preshweb.co.uk> http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb.co.uk/linkedin www.preshweb.co.uk/facebook www.preshweb.co.uk/cpan www.preshweb.co.uk/github