[2.0.1] Load Testing = Thrown(akka.pattern.AskTimeoutException: Timed out)

1,196 views
Skip to first unread message

James Ward

unread,
Jun 14, 2012, 12:48:47 PM6/14/12
to play-fr...@googlegroups.com
Hi all,

I'm doing some load testing of my Play 2 app and getting random errors:

Jun 14 08:57:49 hike-ubertracks app/web.1: [[31merror[0m] play - Cannot invoke the action, eventually got an error: Thrown(akka.pattern.AskTimeoutException: Timed out)

The app doesn't use Akka directly.  I can't find any other error information.  Any ideas on how to find what caused the error?

Thanks.

-James

Sebastian

unread,
Jun 14, 2012, 1:34:57 PM6/14/12
to play-fr...@googlegroups.com
This happens, when play has to wait too long before getting the body parser or the Result (or Promise[Result]) of an action.

If an action needs heavy calculations, you should return a asynchronous Promise[Result] instead of calculating everything before returning from the action. Then play will wait for your result as long as you wish.

If for any reason you don't want to do this, you can increase the waiting time in application.conf. (at the moment I can't find the correct configuration key for it, but I know there is one).

Greetings,

Guillaume Bort

unread,
Jun 14, 2012, 2:06:29 PM6/14/12
to play-fr...@googlegroups.com
Or if the action are blocked in IO (and you can't use async feature because you are using a blocking API like JDBC), you should add more threads to the executor. 
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/9GlvhlpkmxIJ.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

James Ward

unread,
Jun 14, 2012, 2:08:31 PM6/14/12
to play-fr...@googlegroups.com
I bet that is what is happening since the page makes several JDBC
queries. I should be using caching. :)

How do I add more threads to the executor? What is the default?

-James


On 06/14/2012 12:06 PM, Guillaume Bort wrote:
> Or if the action are blocked in IO (and you can't use async feature
> because you are using a blocking API like JDBC), you should add more
> threads to the executor.
>
> On 14 juin 2012, at 19:34, Sebastian <heinz...@googlemail.com
> <mailto:heinz...@googlemail.com>> wrote:
>
>> This happens, when play has to wait too long before getting the body
>> parser or the Result (or Promise[Result]) of an action.
>>
>> If an action needs heavy calculations, you should return a
>> asynchronous Promise[Result] instead of calculating everything before
>> returning from the action. Then play will wait for your result as long
>> as you wish.
>>
>> If for any reason you don't want to do this, you can increase the
>> waiting time in application.conf. (at the moment I can't find the
>> correct configuration key for it, but I know there is one).
>>
>> Greetings,
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "play-framework" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/play-framework/-/9GlvhlpkmxIJ.
>> To post to this group, send email to play-fr...@googlegroups.com
>> <mailto:play-fr...@googlegroups.com>.
>> To unsubscribe from this group, send email to
>> play-framewor...@googlegroups.com
>> <mailto:play-framewor...@googlegroups.com>.
>> For more options, visit this group at
>> http://groups.google.com/group/play-framework?hl=en.
>
> --
> You received this message because you are subscribed to the Google
> Groups "play-framework" group.

Guillaume Bort

unread,
Jun 14, 2012, 2:22:01 PM6/14/12
to play-fr...@googlegroups.com
Check here:

http://www.playframework.org/documentation/2.0.1/AkkaCore

You need to change the parrallelism-factor of the Action dispatcher. Default is 1.0 meaning that it will use as many thread as available CPU. It is a very good default for fully async or CPU intensive applications, but very bad for the ones blocking in IO.
Reply all
Reply to author
Forward
0 new messages