在加特林请求超时 [英] Request timeout in Gatling

查看:114
本文介绍了在加特林请求超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用maven来运行我的Gatling(Scala)性能测试.

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

当我将用户数从100增加到150时,它给了我请求超时的问题.

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

如果将用户数设置为300,则在模拟日志中会出现以下错误.

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)  

错误:-j.u.c.TimeoutException:在120000之后读取到/IP:80的超时ms GROUP无法建立请求Request_1:未命名属性定义了"auth_token"

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

以下是配置:

//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                

推荐答案

对于您的特定情况,该错误是@ user666在注释部分已经提到的错误,但是如果您想增加加特林脚本的请求时间,以便保持连接状态:

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. 编辑Gatling.conf文件
  2. 取消注释requestTimeout行
  3. 提供您希望保持连接状态的时间(以毫秒为单位)

这篇关于在加特林请求超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆