<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div><br></div>Actually, I have a site now providing two services. One is web powered by Dancer, and one is api server.<div><br><div>http://hostname/forum ==> all HTML staff and of course database staff</div><div>http://hostname/api ==> RESTful api, only retrieve data from backend database and return it back to client.</div><div><br></div><div>And now /api request grows up and affect /forum. </div><div><br></div><div>So is it possible to let Starman process /api directly, and dancer handle /forum only? </div><div>I dont want to introduce nginx or anything else.<br><br><div>> Date: Thu, 30 May 2013 09:58:26 +0100<br>> From: davidp@preshweb.co.uk<br>> To: dancer-users@dancer.pm<br>> Subject: Re: [dancer-users] Dancer on Starman, why slow down?<br>> <br>> On Thu, 30 May 2013 15:56:45 +0900<br>> hommura hiroaki <hommura_hiroaki@outlook.com> wrote:<br>> <br>> > Hi all,<br>> > Why dancer on starman becomes very slow? Am I doing something wrong?<br>> > #### directly starman$ cat app.psgimy $app = sub { return<br>> > [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello World' ] ];};$<br>> > starman &$ ab gives me 4000 reqs/second #### directly dancer$ cat<br>> > app.pl#!/usr/bin/env perluse Dancer;get '/' => sub { "Hello<br>> > World!" };dance; $ perl app.pl &$ ab gives me 600 reqs/second ####<br>> > dancer on starman$ starman app.pl &$ ab still gives me 600<br>> > reqs/second Why so slow?Is it possible let dancer deal with HTML<br>> > request, and starman deal with non-HTML request directly? <br>> <br>> Yeah, Dancer will be slower than a bare-bones PSGI app, as, well, it's<br>> giving you a lot of features, which don't come free. 600 req/sec is<br>> still pretty fast, I'd say :)<br>> <br>> I think what you're asking for is to prevent static requests (images,<br>> stylesheets etc) reaching Dancer, which is sensible; I tend to have my<br>> Dancer apps proxied behind nginx, and configure nginx to serve up the<br>> static stuff for me, so those requests never hit the Dancer app.<br>> Pretty sure there's an example of that in the deployment docs.<br>> <br>> Cheers<br>> <br>> Dave P<br>> <br>> -- <br>> David Precious ("bigpresh") <davidp@preshweb.co.uk><br>> http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter<br>> www.preshweb.co.uk/linkedin www.preshweb.co.uk/facebook<br>> www.preshweb.co.uk/cpan www.preshweb.co.uk/github<br>> <br>> <br>> _______________________________________________<br>> dancer-users mailing list<br>> dancer-users@dancer.pm<br>> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users<br></div></div></div>                                            </div></body>
</html>