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: [email protected] > To: [email protected] > Subject: Re: [dancer-users] Dancer on Starman, why slow down? > > On Thu, 30 May 2013 15:56:45 +0900 > hommura hiroaki <[email protected]> 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") <[email protected]> > 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 > [email protected] > http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list [email protected] http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
