# \[Gatling 1.5.2\] : scenario can't repeat the execution

**URL:** <https://community.gatling.io/t/gatling-1-5-2-scenario-cant-repeat-the-execution/647>\
**Category:** Gatling (Open-Source)\
**Created:** [November 4, 2013, 5:52am UTC](https://community.gatling.io/t/gatling-1-5-2-scenario-cant-repeat-the-execution/647 "2013-11-04T05:52:18Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kunsou\_irt](https://avatars.discourse-cdn.com/v4/letter/k/96bed5/32.png) [@Kunsou\_irt](https://community.gatling.io/u/Kunsou_irt)\
**Post date:** [November 4, 2013, 5:52am UTC](https://community.gatling.io/t/gatling-1-5-2-scenario-cant-repeat-the-execution/647/1 "2013-11-04T05:52:18Z")

</div>

I make a simple simulation like following, but when I run it , totally the 250 user only send out 250 request in about 10min, but I expect more requests (250\*600 over 10 min) were sent out.

> **_class MySimulation extends Simulation {_**
> 
> **_val httpConf = httpConfig_**  
> **_.baseURL(“[http://myhost](http://myhost)”)_**  
> **_.acceptCharsetHeader(“ISO-8859-1,utf-8;q=0.7,\*;q=0.7”)_**  
> **_.acceptHeader(“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8”)_**  
> **_.acceptEncodingHeader(“gzip, deflate”)_**  
> **_.acceptLanguageHeader(“fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3”)_**  
> **_.disableFollowRedirect_**
> 
> **_val headers\_1 = Map(_**  
> **_“Keep-Alive” → “115”)_**
> 
> **_val scn = scenario(“Scenario\_namex”)_**  
> **_.repeat(600, “longrun”) {_**  
> **_exec(_**  
> **_http(“request\_x1”)_**  
> **_.get(“/service/get\_feed?fn=x&Param=12345”)_**  
> **_).pause(1)_**
> 
> **_}_**  
> **_setUp(scn.users(250).ramp(20).protocolConfig(httpConf))_**  
> **_}_**

I also try to use **_during(600 seconds, “longrun”)_** instead of repeat, but get the same result

what’ wrong with my scenario? How can I load the stress?

Thanks  
Kunsou

---

<div class="post-metadata">

**Author:** ![Kunsou\_irt](https://avatars.discourse-cdn.com/v4/letter/k/96bed5/32.png) [@Kunsou\_irt](https://community.gatling.io/u/Kunsou_irt)\
**Post date:** [November 4, 2013, 5:56am UTC](https://community.gatling.io/t/gatling-1-5-2-scenario-cant-repeat-the-execution/647/2 "2013-11-04T05:56:43Z")

</div>

attached my log

[simulation.log](https://community.gatling.io/uploads/short-url/pzCSVQyNtT7pKw2AjFcbkKl2j5U.log) (46.6 KB)

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 4, 2013, 6:41am UTC](https://community.gatling.io/t/gatling-1-5-2-scenario-cant-repeat-the-execution/647/3 "2013-11-04T06:41:59Z")

</div>

Hi,

Your simulation looks fine (and is fine, I tested it against Google and it works as expected).

Are you sure you’re properly saving the file?  
How do you run Gatling? bundle? ide? maven? Could be a bytecode cache problem.

Stéphane

---

<div class="post-metadata">

**Author:** ![Kunsou\_irt](https://avatars.discourse-cdn.com/v4/letter/k/96bed5/32.png) [@Kunsou\_irt](https://community.gatling.io/u/Kunsou_irt)\
**Post date:** [November 4, 2013, 7:26am UTC](https://community.gatling.io/t/gatling-1-5-2-scenario-cant-repeat-the-execution/647/4 "2013-11-04T07:26:19Z")

</div>

Thank you for your quick response!

scripts is put to the user-files\simulations\basic directory.（posted script just only change some variable names）,And I just use the gatling.bat/sh to choose the simulation;

following terminal is the result I was running under windows days before(jdk 1.6.0.45),

But today I deploy the code to a fresh gatling environment under ubuntu (gatling is downloaded from your binary build, using openjdk 1.6.0\_27), previous posted log got by this run.

I also monitoring my Ethernet adapter’s activity in the running. When all the 250 user are up, the net flow dropped to zero, It seemed that all the user just sent out request then paused forever.

> **_C:\platform\codebase\gatling-charts-highcharts-1.5.2\bin\>gatling.bat_**  
> **_GATLING\_HOME is set to “C:\platform\codebase\gatling-charts-highcharts-1.5.2”_**  
> **_Choose a simulation number:_**  
> **_[0] advanced.AdvancedExampleSimulation_**  
> **_[1] basic.BasicExampleSimulation_**  
> **_[2] basic.ElementsSimulation_**  
> **_2_**  
> **_Select simulation id (default is ‘elementssimulation’). Accepted characters are_**  
> **_a-z, A-Z, 0-9, - and \__**
> 
> **_Select run description (optional)_**
> 
> **_Simulation basic.ElementsSimulation started…_**  
> **_================================================================================_**
> 
> **_2013-11-02 12:31:00 5s elapsed_**
> 
> **_---- Scenario\_namex ------------------------------------------------------------_**
> 
> **_Users : [-----------------] 0%_**
> 
> **_waiting:187 / running:63 / done:0_**  
> **_---- Requests ------------------------------------------------------------------_**
> 
> **_\> Global OK=53 KO=0_**
> 
> **_\> request\_x1 OK=53 KO=0_**
> 
> **_================================================================================_**
> 
> **_================================================================================_**
> 
> **_2013-11-02 12:31:06 10s elapsed_**
> 
> **_---- Scenario\_namex ------------------------------------------------------------_**
> 
> **_Users : [---------------------------------] 0%_**
> 
> **_waiting:124 / running:126 / done:0_**  
> **_---- Requests ------------------------------------------------------------------_**
> 
> **_\> Global OK=116 KO=0_**
> 
> **_\> request\_x1 OK=116 KO=0_**
> 
> **_================================================================================_**
> 
> **_================================================================================_**
> 
> **_2013-11-02 12:31:11 15s elapsed_**
> 
> **_---- Scenario\_namex ------------------------------------------------------------_**
> 
> **_Users : [--------------------------------------------------] 0%_**
> 
> **_waiting:61 / running:189 / done:0_**  
> **_---- Requests ------------------------------------------------------------------_**
> 
> **_\> Global OK=181 KO=0_**
> 
> **_\> request\_x1 OK=181 KO=0_**
> 
> **_================================================================================_**
> 
> **_================================================================================_**
> 
> **_2013-11-02 12:31:16 20s elapsed_**
> 
> **_---- Scenario\_namex ------------------------------------------------------------_**
> 
> **_Users : [-----------------------------------------------------------------] 0%_**
> 
> **_waiting:0 / running:250 / done:0_**  
> **_---- Requests ------------------------------------------------------------------_**
> 
> **_\> Global OK=242 KO=0_**
> 
> **_\> request\_x1 OK=242 KO=0_**
> 
> **_================================================================================_**

在 2013年11月4日星期一UTC+8下午2时41分59秒，Stéphane Landelle写道：

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 4, 2013, 10:07am UTC](https://community.gatling.io/t/gatling-1-5-2-scenario-cant-repeat-the-execution/647/5 "2013-11-04T10:07:30Z")

</div>

Could you please tell me what you get when running this simulation?

[MySimulation.scala](https://community.gatling.io/uploads/short-url/ulnzHRbD8spTfZXVuN3w9THsWqD.scala) (728 Bytes)

---

<div class="post-metadata">

**Author:** ![Kunsou\_irt](https://avatars.discourse-cdn.com/v4/letter/k/96bed5/32.png) [@Kunsou\_irt](https://community.gatling.io/u/Kunsou_irt)\
**Post date:** [November 4, 2013, 11:23am UTC](https://community.gatling.io/t/gatling-1-5-2-scenario-cant-repeat-the-execution/647/6 "2013-11-04T11:23:03Z")

</div>

Yes ,you are right. your scripts run 100 request, see attached the simulation.log

but when I replace the url/path in your script, run again, only get 10 request (see attached simulation\_my\_url.log)

Any thing special with my server? or the intranet?

I paste my inspection from firefox

**Request Headers** 18:48:23.000  
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0  
Host: \*\*\*\*\*\*\*  
DNT: 1  
Connection: keep-alive  
Accept-Language: en-US,en;q=0.5  
Accept-Encoding: gzip, deflate  
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8

**Response Headers** Δ6385ms  
X-Powered-By: Servlet/2.5 JSP/2.1  
Transfer-Encoding: chunked  
Server: Apache  
Keep-Alive: timeout=15, max=1000  
Expires: Mon, 04 Nov 2013 11:38:32 GMT  
Content-Type: application/xml;charset=UTF-8  
Connection: Keep-Alive

在 2013年11月4日星期一UTC+8下午6时07分30秒，Stéphane Landelle写道：

[simulation.log](https://community.gatling.io/uploads/short-url/2wJB1UEW7bVZNljxfp70ArHhs7z.log) (9.81 KB)

[simulation\_my\_url.log](https://community.gatling.io/uploads/short-url/m2xAuNBqFSTH4COp5WbsSG6oGZh.log) (1.8 KB)

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 4, 2013, 12:32pm UTC](https://community.gatling.io/t/gatling-1-5-2-scenario-cant-repeat-the-execution/647/7 "2013-11-04T12:32:25Z")

</div>

Could you change the logging level to TRACE in logback.xml conf file, please?

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 4, 2013, 12:33pm UTC](https://community.gatling.io/t/gatling-1-5-2-scenario-cant-repeat-the-execution/647/8 "2013-11-04T12:33:04Z")

</div>

And just run with 1 user (will be easier to debug).

---

<div class="post-metadata">

**Author:** ![Kunsou\_irt](https://avatars.discourse-cdn.com/v4/letter/k/96bed5/32.png) [@Kunsou\_irt](https://community.gatling.io/u/Kunsou_irt)\
**Post date:** [November 5, 2013, 3:07am UTC](https://community.gatling.io/t/gatling-1-5-2-scenario-cant-repeat-the-execution/647/9 "2013-11-05T03:07:46Z")

</div>

Your suggestion is great!! : one user, 10 repeat , using my service url

Following is output: the request is cached!!  
So I just add .disableCaching to an HTTP Protocol Configuration definition. then total request is 10!

I also check the [google.fr](http://google.fr) respons head : expires=-1, which may be the difference??

> _ **Session:** _
> 
> _**scenarioName=‘Scenario\_namex’ userId=‘1’ data='Map(longrun → 0, gatling.http.re**_
> 
> _**ferer → http://--------------)’**_
> 
> _ **=========================** _
> 
> _ **HTTP request:** _
> 
> _ **GET http://-------------** _
> 
> _ **headers=** _
> 
> _ **Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8** _
> 
> _ **Accept-Charset: ISO-8859-1,utf-8;q=0.7,\*;q=0.7** _
> 
> _ **Accept-Encoding: gzip, deflate** _
> 
> _ **=========================** _
> 
> _ **HTTP response:** _
> 
> _ **status=** _
> 
> _ **200 OK** _
> 
> _ **headers=** _
> 
> _ **Transfer-Encoding: chunked** _
> 
> _ **Content-Type: application/xml;charset=UTF-8** _
> 
> _ **Connection: Keep-Alive** _
> 
> _ **Date: Tue, 05 Nov 2013 02:41:28 GMT** _
> 
> _ **Server: Apache** _
> 
> _ **Keep-Alive: timeout=15, max=1000** _
> 
> _ **X-Powered-By: Servlet/2.5 JSP/2.1** _
> 
> _ **Expires: Tue, 05 Nov 2013 04:41:34 GMT** _
> 
> _ **\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<** _
> 
> _**10:41:37.969 [INFO] c.e.e.g.c.a.PauseAction - Pausing for 1000ms (real=915ms)**_
> 
> _ **================================================================================** _
> 
> _ **2013-11-05 10:41:37 10s elapsed** _
> 
> _ **---- Scenario\_namex ------------------------------------------------------------** _
> 
> _**Users : [-----------------------------------------------------------------] 0%**_
> 
> _ **waiting:0 / running:1 / done:0** _
> 
> _ **---- Requests ------------------------------------------------------------------** _
> 
> _ **\> Global OK=1 KO=0** _
> 
> _ **\> Query OK=1 KO=0** _
> 
> _ **================================================================================** _
> 
> _**10:41:38.925 [INFO] c.e.e.g.h.a.HttpRequestAction - Bypassing cached Request 'Q**_
> 
> _ **uery’: Scenario ‘Scenario\_namex’, UserId #1** _
> 
> _**10:41:38.927 [INFO] c.e.e.g.c.a.PauseAction - Pausing for 1000ms (real=964ms)**_
> 
> _**10:41:39.925 [INFO] c.e.e.g.h.a.HttpRequestAction - Bypassing cached Request 'Q**_
> 
> _ **uery’: Scenario ‘Scenario\_namex’, UserId #1** _
> 
> _**10:41:39.926 [INFO] c.e.e.g.c.a.PauseAction - Pausing for 1000ms (real=970ms)**_
> 
> _**10:41:40.927 [INFO] c.e.e.g.h.a.HttpRequestAction - Bypassing cached Request 'Q**_
> 
> _ **uery’: Scenario ‘Scenario\_namex’, UserId #1** _
> 
> _**10:41:40.928 [INFO] c.e.e.g.c.a.PauseAction - Pausing for 1000ms (real=973ms)**_
> 
> _**10:41:41.929 [INFO] c.e.e.g.h.a.HttpRequestAction - Bypassing cached Request 'Q**_
> 
> _ **uery’: Scenario ‘Scenario\_namex’, UserId #1** _
> 
> _**10:41:41.930 [INFO] c.e.e.g.c.a.PauseAction - Pausing for 1000ms (real=976ms)**_
> 
> _**10:41:42.931 [INFO] c.e.e.g.h.a.HttpRequestAction - Bypassing cached Request 'Q**_
> 
> _ **uery’: Scenario ‘Scenario\_namex’, UserId #1** _
> 
> _**10:41:42.932 [INFO] c.e.e.g.c.a.PauseAction - Pausing for 1000ms (real=980ms)**_
> 
> _**10:41:43.933 [INFO] c.e.e.g.h.a.HttpRequestAction - Bypassing cached Request 'Q**_
> 
> _ **uery’: Scenario ‘Scenario\_namex’, UserId #1** _
> 
> _**10:41:43.934 [INFO] c.e.e.g.c.a.PauseAction - Pausing for 1000ms (real=983ms)**_
> 
> _**10:41:44.935 [INFO] c.e.e.g.h.a.HttpRequestAction - Bypassing cached Request 'Q**_
> 
> _ **uery’: Scenario ‘Scenario\_namex’, UserId #1** _
> 
> _**10:41:44.936 [INFO] c.e.e.g.c.a.PauseAction - Pausing for 1000ms (real=986ms)**_
> 
> _**10:41:45.937 [INFO] c.e.e.g.h.a.HttpRequestAction - Bypassing cached Request 'Q**_
> 
> _ **uery’: Scenario ‘Scenario\_namex’, UserId #1** _
> 
> _**10:41:45.938 [INFO] c.e.e.g.c.a.PauseAction - Pausing for 1000ms (real=990ms)**_
> 
> _**10:41:46.938 [INFO] c.e.e.g.h.a.HttpRequestAction - Bypassing cached Request 'Q**_
> 
> _ **uery’: Scenario ‘Scenario\_namex’, UserId #1** _
> 
> _**10:41:46.939 [INFO] c.e.e.g.c.a.PauseAction - Pausing for 1000ms (real=993ms)**_
> 
> _**10:41:47.939 [INFO] c.e.e.g.c.a.UserAction - END user #1**_
> 
> _ **================================================================================** _
> 
> _ **2013-11-05 10:41:47 20s elapsed** _
> 
> _ **---- Scenario\_namex ------------------------------------------------------------** _
> 
> _**Users : [#################################################################]100%**_
> 
> _ **waiting:0 / running:0 / done:1** _
> 
> _ **---- Requests ------------------------------------------------------------------** _
> 
> _ **\> Global OK=1 KO=0** _
> 
> _ **\> Query OK=1 KO=0** _
> 
> _ **================================================================================** _
> 
> _**10:41:47.953 [INFO] c.e.e.g.c.r.w.FileDataWriter - Received flush order**_
> 
> _ **Simulation finished.** _

在 2013年11月4日星期一UTC+8下午8时33分04秒，Stéphane Landelle写道：

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 5, 2013, 6:20am UTC](https://community.gatling.io/t/gatling-1-5-2-scenario-cant-repeat-the-execution/647/10 "2013-11-05T06:20:42Z")

</div>

I feel stupid for not noticing your Expire header.  
Until next Gatling milestone (2M4), Gatling is considering Expire header in an agressive way, treating every future date as “forever”.  
Anyway, if your response is cached with Expire, Gatling will bypass the request, just like a browser, hence your very long period with Gatling not sending any request (actually performing the pauses in your loop).

Regarding the -1 value that Google returns, it has to be handled as an invalid value (a valid Expire is a date), meaning “already expired” =\> if it was cached, flush it.

Glad you finally sorted it out!

---

<div class="post-metadata">

**Author:** ![Kunsou\_irt](https://avatars.discourse-cdn.com/v4/letter/k/96bed5/32.png) [@Kunsou\_irt](https://community.gatling.io/u/Kunsou_irt)\
**Post date:** [November 5, 2013, 11:03am UTC](https://community.gatling.io/t/gatling-1-5-2-scenario-cant-repeat-the-execution/647/11 "2013-11-05T11:03:14Z")

</div>

Thank you kind help!! 🙂

I do think end user should be notified the cache concern when using the **repeat/during**.

在 2013年11月5日星期二UTC+8下午2时20分42秒，Stéphane Landelle写道：

---

<div class="post-metadata">

**Author:** ![Francisco\_Manuel\_Ser](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@Francisco\_Manuel\_Ser](https://community.gatling.io/u/Francisco_Manuel_Ser)\
**Post date:** [January 2, 2014, 9:57pm UTC](https://community.gatling.io/t/gatling-1-5-2-scenario-cant-repeat-the-execution/647/12 "2014-01-02T21:57:07Z")

</div>

It works for me too…

Thanks!!
