Request timeout in Gatling
Asked Answered
G

1

7

I am using maven to run my Gatling (Scala) performance test.

It gives me request timeout issue when I increase user from 100 to 150.

If I set the number of user to 300, then I get following error in simulation log.

// Gatling scenario injection
val scn =  scenario("UATEnvironmentTest")
.exec(http("AdminLoginRequest")
.post("/authorization_microservice/oauth/token")
.headers(headers_1).body(RawFileBody("Login.txt"))
.check(jsonPath("$.access_token")
.saveAs("auth_token")))
.pause(2)  

setUp(scn.inject(nothingFor(5 seconds),atOnceUsers(50),rampUsers(250) over(10 seconds))).protocols(httpProtocol)  

Error :- j.u.c.TimeoutException: Read timeout to /IP:80 after 120000 ms GROUP Failed to build request Request_1: No attribute named 'auth_token' is defined

Following is the configuration:

//Maven configuration-pom.xml
java.version 1.8
gatling.version 2.2.3
gatling-plugin.version 2.2.1
scala-maven-plugin.version 3.2.2
// Gatling.conf file
connectTimeout 120000                         
handshakeTimeout 120000                       
pooledConnectionIdleTimeout 120000                  
readTimeout 120000                             
requestTimeout 120000                
Gallium answered 9/12, 2017 at 16:0 Comment(3)
Hi , I increased following values. connectTimeout = 600000 handshakeTimeout = 600000 pooledConnectionIdleTimeout = 600000 readTimeout = 600000 requestTimeout = 600000. Result are promising to me . ThanksGallium
Thanks @PhonologGallium
The error is "No attribute named 'auth_token'" and not what you are lookingBobo
N
6

For your particular case, the error is what already mentioned by @user666 in the comment section, but if you wanted to increase the request time out of Gatling Scripts, so that the connection stays:

  1. Edit the Gatling.conf file
  2. Uncomment the requestTimeout line
  3. Provide the time in milliseconds you wanted your connection to be kept alive
Nuggar answered 20/12, 2018 at 2:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.