Error : Futures timed out after [20000] milliseconds when looping in scenario

Hello,

I have an error when I run my simulation.
Here the context :
On my Simulation :

List(
Scenario4.scnPic.configure.users(100).ramp(100*60).protocolConfig(httpConf),

Scenario4.scnPic.configure.users(100).ramp(100*60).protocolConfig(httpConf),

(x times this line …)
[…]
)

On Scenario4 :

val scnPic = scenario(""“Scenario 4 Pic”"")
.loop(chain
.insertChain(chain_connexion)
.insertChain(chain_0)
.insertChain(chain_1)
.insertChain(chain_deconnexion)
).during(10, HOURS)

It works if :

  • List on Simulation is composed with few or less items of Scenario4 ( +/- 10 items)
  • List on Simulation is composed with many ( 20 or more ) items of Scenario4 AND if I remove the loop ( loop - during ) on Scenario4

When it fails, I got this :

Exception in thread “main” java.util.concurrent.TimeoutException: Futures timed out after [20000] milliseconds
at akka.dispatch.DefaultPromise.ready(Future.scala:870)
at akka.dispatch.DefaultPromise.result(Future.scala:874)
at akka.dispatch.Await$.result(Future.scala:74)
at akka.actor.ActorSystemImpl.actorOf(ActorSystem.scala:493)
at com.excilys.ebi.gatling.core.action.builder.StartActionBuilder.build(StartActionBuilder.scala:43)
at com.excilys.ebi.gatling.core.structure.AbstractStructureBuilder.buildChainedActions$1(AbstractStructureBuilder.scala:184)
at com.excilys.ebi.gatling.core.structure.AbstractStructureBuilder.buildChainedActions(AbstractStructureBuilder.scala:188)
at com.excilys.ebi.gatling.core.structure.ScenarioBuilder.build(ScenarioBuilder.scala:72)
at com.excilys.ebi.gatling.core.runner.Runner$$anonfun$3.apply(Runner.scala:51)
at com.excilys.ebi.gatling.core.runner.Runner$$anonfun$3.apply(Runner.scala:49)

[…]

[ERROR] [08/02/2012 12:11:15.351] [GatlingSystem-akka.actor.default-dispatcher-2] [akka://GatlingSystem/user/$F] error while creating actor
java.util.concurrent.TimeoutException: Futures timed out after [20000] milliseconds
at akka.dispatch.DefaultPromise.ready(Future.scala:870)
at akka.dispatch.DefaultPromise.result(Future.scala:874)

[…]

Changing the value of during doesn’t help. I try 0 with no success.

Anyone can explain me the error, and hopefully got an idea to solve it :slight_smile:

Denis V.

Hello Denis,

I’m going to have a look at this this afternoon. It seems Akka have problems instanciating many Actors from the same parent.

How many actions (requests + pause) do you have in chain_connexion, chain_0, chain_1 and chain_deconnexion, please?

Cheers,

Stéphane

2012/8/2 DeV@n <vanpeperstraete.d@mipih.fr>

Also, do you think you could pass me you Simulation (with anonymized urls if you want)?

2012/8/2 Stéphane Landelle <slandelle@excilys.com>

Hello Stéphane,

chain_connexion : 32 requests + 25 pauses ( total pause : ~= 41 sec.)
chain_0 : 25 requests + 17 pauses ( total pause : ~= 43 sec. )
chain_1 : 11 requests + 11 pauses ( total pause : ~= 35 sec. )
chain_deconnexion : 3 requests + 3 pauses ( total pause : = 26 sec. )

I reproduce the problem with other scenario which looks like this one ( with different number of request and pause )

Thanks for your reactivity :slight_smile:

I’m looking for that :slight_smile:

I forgot to mention that I usually run Gatling in 1.2.3, but I have reproduced the problem in 1.2.5

The fastest way to make your simulation run is to increase the Akka actor creation timeout (which is, as you noticed, 20s).
What you have to do is to add an file named “application.conf” and put it into the Gatling conf folder.

You can find a template of this file in the akka-core jar.
Basically, your file should look like this:

akka {
actor {

increase from 20s to 60s

creation-timeout = 60s
}
}

However, I’d like to fix/optimize this and not only provide a workaround, so it’d be really great if you could provide your Simulation.
Your system taking more than 20s to start up is very wrong.

Cheers,

Steph

2012/8/2 DeV@n <vanpeperstraete.d@mipih.fr>

I joined my scala files. Tell me if you need request-bodies too.

My computer is pretty fast ( Intel Core i5 CPU @ 3.30 GHz, 4 Go RAM, SSD disk ), and I think you are right when you say it’s an optimization problem. So far, some configuration running on my computer doesn’t run on a Linux VM (which is a bit slower)

I’ll try to increase the creation timeout value, and give you results

scala.zip (3.71 KB)

OK, I’m on it.

Just one thing, your class Scenario4 should be renamed into EspicScenario4 so that SimulationEspicT1 compiles.

I’ll keep you updated.

Steph

2012/8/2 DeV@n <vanpeperstraete.d@mipih.fr>

Yes, I have renamed the scenario from EspicScenario4 to Scenario4, but I forgot this point :wink:

Could you provide the following information:

  • OS
  • JDK
  • When does the exception occur? On start-up, just after selecting the Simulation to be run, right?

2012/8/2 DeV@n <vanpeperstraete.d@mipih.fr>

  • OS : Windows 7 Enterprise SP1 32 bits
  • JDK : 1.6.0_26
  • The Exception occurs after :
    “Simulation …SimulationEspicT1 started…”
    [ wait for 20 sec. ]

Exception in thread “main” [ERROR] [08/02/2012 11:57:55.150] [GatlingSystem-akka.actor.default-dispatcher-11] [akka://GatlingSystem/user/$C] error while creating actor

Changing value of creation-timeout doesn’t help.
On the main Simulation, if I have 11 times the line “Scenario4.scnPic.configure.users(100).ramp(100*60).protocolConfig(httpConf)” on the List, my Sim works.
When it’s 12, I got the error. After that, I push the creation-timeout to 60 sec.
Infortunately, I have the same error as always, just the information about the timeout is different (so that show me the value is well changed) :
Exception in thread “main” java.util.concurrent.TimeoutException: Futures timed out after [60000] milliseconds

Hope it helps,

Denis

I fear this will be a real headache: I have no problem starting your Simulation on my Mac, except, of course, that I get some “Connection refused” as xxxxxxxxxxx is not a real host name. Launching is also almost immediate.

How do you launch Gatling? Do you use a bundle launched from the command line? an IDE? the maven plugin?

2012/8/2 DeV@n <vanpeperstraete.d@mipih.fr>

I launch Gatling with Eclipse, or from the command line, with the same result.
I also try with the modified files I sent, I got the same error.

I’ll with another JVM.

Have you try to add more Scenario4 in the List ?

OK, I doubled them and was able to reproduce!
I’ll keep you updated.

2012/8/2 DeV@n <vanpeperstraete.d@mipih.fr>

Just one thing: did you tune your JVM, when launching the Engine class?
Here are the options I use:

-server
-XX:+UseThreadPriorities
-XX:ThreadPriorityPolicy=42
-Xms512M
-Xmx512M
-Xmn100M
-Xss1M
-XX:+HeapDumpOnOutOfMemoryError
-XX:+AggressiveOpts
-XX:+OptimizeStringConcat
-XX:+UseFastAccessorMethods
-XX:+UseParNewGC
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:SurvivorRatio=8
-XX:MaxTenuringThreshold=1
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly

2012/8/2 Stéphane Landelle <slandelle@excilys.com>

No, JVM is not tuned.
I also try with JDK 1.7, same result.

Happy you reproduce the error ^^

Denis

Great news: I pinned it!
see https://github.com/excilys/gatling/issues/622

You have to possibilities:

  • build 1.3.0-SNAPSHOT from sources (tell me if you need help)
  • use a loop.times instead of a loop.during as it’s not implemented the same way
    Thanks for reporting,

Steph

2012/8/2 DeV@n <vanpeperstraete.d@mipih.fr>

FYI, I just uploaded a SNAPSHOT:
https://github.com/downloads/excilys/gatling/gatling-charts-highcharts-1.3.0-SNAPSHOT-bundle.zip

2012/8/2 Stéphane Landelle <slandelle@excilys.com>

Great !

It now works like a charm :slight_smile:
Big thanks for your quick and efficient response !!

Denis