[dancer-users] Dancer on Starman, why slow down?
hommura hiroaki
hommura_hiroaki at outlook.com
Fri May 31 10:49:29 BST 2013
Actually, I have a site now providing two services. One is web powered by Dancer, and one is api server.
http://hostname/forum ==> all HTML staff and of course database staffhttp://hostname/api ==> RESTful api, only retrieve data from backend database and return it back to client.
And now /api request grows up and affect /forum.
So is it possible to let Starman process /api directly, and dancer handle /forum only? I dont want to introduce nginx or anything else.
> Date: Thu, 30 May 2013 09:58:26 +0100
> From: davidp at preshweb.co.uk
> To: dancer-users at dancer.pm
> Subject: Re: [dancer-users] Dancer on Starman, why slow down?
>
> On Thu, 30 May 2013 15:56:45 +0900
> hommura hiroaki <hommura_hiroaki at 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 at 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
>
>
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20130531/0ccd7e53/attachment.htm>
More information about the dancer-users
mailing list