Play! server - strange performance issue

137 views
Skip to first unread message

Kamil Afsar

unread,
Oct 24, 2011, 3:15:40 PM10/24/11
to play-framework
Dear play community,

I'm trying to benchmark my app with ab (ApacheBench), and I'm getting
very strange results.

To debug the problem with my app, I created a new app which has only
one controller method and outputs a random string. I left all
configuration default, except for the application.mode, which I set to
"prod". (Because "dev" runs with only one thread). When I run ab,
with something like "ab -n 100 -c 5 http://somehost.com" the test will
never end, and eventually result in timeouts and a request/per second
of 0.07. Exactly the same situation with my app, meaning there is
nothing wrong with my code, phew! ;-)

Here comes the strange thing: when I use Apache Httpd in front of
play! (port 9000) everything is just normal again, my request/per
second increases to 600+ requests per second.

Here is my setup:
Play 1.2.3
- sass1.1
- scala 0.9.1

Tested on OSX and CentOS, same results.

How am I supposed to run play! as front end webserver? I don't want to
use Httpd, because that will add just another complexity, which I
rather don't want. Besides the play! documentation says:

"Note that using a front-end HTTP server will never give you better
performance than using play server directly!"
http://www.playframework.org/documentation/1.0/production

I must doing something terribly wrong, but what?

Thanks in advance!

Kamil

Alonso

unread,
Dec 6, 2011, 11:36:49 AM12/6/11
to play-framework
I'm having the exact same problem. Running play on Mac OS Lion. Even a
simple ab http://localhost:9000/ does not work and I start getting
error like the following in the play console:

ab http://localhost:9000/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)...apr_poll: The timeout specified
has expired (70007)

In play console after a couple of minutes:

*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding"
with message can't create byte arrau at ../../../src/share/instrument/
JPLISAgent.c line: 775


On 24 oct, 13:15, Kamil Afsar <kamil.afs...@gmail.com> wrote:
> Dear play community,
>
> I'm trying to benchmark my app with ab (ApacheBench), and I'm getting
> very strange results.
>
> To debug the problem with my app, I created a new app which has only
> one controller method and outputs a random string. I left all
> configuration default, except for the application.mode, which I set to
> "prod". (Because "dev" runs with only one thread).  When I run ab,

> with something like "ab -n 100 -c 5http://somehost.com" the test will

Brian Nesbitt

unread,
Dec 6, 2011, 1:26:25 PM12/6/11
to play-fr...@googlegroups.com
try using 127.0.0.1 instead of localhost

Brian Nesbitt

unread,
Dec 6, 2011, 1:28:19 PM12/6/11
to play-fr...@googlegroups.com
try "ab -n 1 -c 1 http://127.0.0.1:9000/" and see if that responds?!?

Then move onto "ab -n 100 -c 1 http://127.0.0.1:9000/" ....
"ab -n 100 -c 5 http://127.0.0.1:9000/" .... etc.
Reply all
Reply to author
Forward
0 new messages