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

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”)
.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

attached my log

simulation.log (46.6 KB)

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

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写道:

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

MySimulation.scala (728 Bytes)

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 (9.81 KB)

simulation_my_url.log (1.8 KB)

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

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

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 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写道:

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!

Thank you kind help!! :slight_smile:

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写道:

It works for me too…

Thanks!!