gatling - 批量使用 feeder,QPS 会很低,我的脚本有问题吗,tks
问题描述
csv文件大约47MB,如果我不使用batch
,加载文件会花费很多时间,QPS可以达到8000+。
不要使用批处理
但如果我使用batch(10000)
甚至更多batch(100000)
,QPS 将非常低,大约 800+。(文件有 100000 条记录)
使用批处理(100000)
像这样的脚本:
import io.gatling.core.Predef._
import io.gatling.core.feeder.BatchableFeederBuilder
import io.gatling.core.structure.ScenarioBuilder
import io.gatling.http.Predef._
import io.gatling.http.protocol.HttpProtocolBuilder
import scala.concurrent.duration._
class SuggestDot extends Simulation {
val protoal: HttpProtocolBuilder = http.warmUp("https://www.baidu.com")
.baseUrl("http://192.168.106.142:8080")
.connectionHeader("keep-alive")
.check(jsonPath("$.ret").ofType[Int] is 0)
.check(jsonPath("$.data.data[0]") exists)
val files: BatchableFeederBuilder[String]#F = csv("suggestDot.csv").batch(100000).circular
val test: ScenarioBuilder = scenario("lalamap.myhll.cn").forever(
feed(files).exec(
http("suggest/doc")
.get("${url}&isNewVersion=true")
)
)
setUp(
test.inject(atOnceUsers(100)).protocols(protoal)
).maxDuration(60 seconds)
}
解决方案
这将在即将发布的 Gatling 3.4.0 中修复,请参阅https://github.com/gatling/gatling/issues/3943和https://github.com/gatling/gatling/issues/3944。
顺便说一句,我可以从你的屏幕截图中看到你已经分叉了 Gatling。请考虑成为一名优秀的开源公民并为上游做出贡献。
推荐阅读
- swift - 我怎样才能得到绝对值的 ARAnchor 的偏航、俯仰、滚动?
- webpack - Webpack:在生产构建中使用 webpack-manifest-plugin 处理静态资产
- swift - 尝试从 firebase 数据库中检索类别列表( swift )
- python - Django 2.1:如何获取每个对象中的对象列表,其中包含具有指向它们的外键的对象
- linux - 上传/下载较大文件时,服务器不返回任何内容(无标题、无数据)
- c# - .NET 列表
.Sort 使用 introsort,为什么最坏的情况是 O(n^2)? - mysql - MySQL 和 Laravel - 在之前和之后检查现有记录
- angular - Angular中canactivate方法中的API调用
- php - 如何清理查询以接受表名作为参数 PDO php
- angular6 - 无法使用 HttpTestController 在 Jasmine 和 Karma 中模拟 HttpClient