【问题标题】:Request timeout in GatlingGatling 中的请求超时
【发布时间】:2018-05-23 15:30:07
【问题描述】:

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

当我将用户从 100 增加到 150 时,它会出现请求超时问题。

如果我将用户数设置为 300,那么我会在模拟日志中收到以下错误。

// 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' 已定义

以下是配置:

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

【问题讨论】:

  • 嗨,我增加了以下值。 connectTimeout = 600000 handshakeTimeout = 600000 pooledConnectionIdleTimeout = 600000 readTimeout = 600000 requestTimeout = 600000。结果对我来说很有希望。谢谢
  • 谢谢@Phonolog
  • 错误是“没有名为 'auth_token' 的属性”,而不是您正在查看的内容

标签: scala maven gatling


【解决方案1】:

对于您的特定情况,错误是 @user666 在评论部分已经提到的,但是如果您想增加 Gatling Scripts 的请求时间,以便保持连接:

  1. 编辑 Gatling.conf 文件
  2. 取消注释 requestTimeout 行
  3. 提供您希望连接保持活动的时间(以毫秒为单位)

【讨论】:

    猜你喜欢
    • 2015-03-20
    • 2011-02-26
    • 1970-01-01
    • 2020-08-27
    • 1970-01-01
    • 2023-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多