Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

负载变化时导致并发突增 #173

Closed
daocoder2 opened this issue Aug 30, 2022 · 4 comments
Closed

负载变化时导致并发突增 #173

daocoder2 opened this issue Aug 30, 2022 · 4 comments

Comments

@daocoder2
Copy link

locust version: 2.8.0
boomer: master

locust原生界面记录:
阶梯负载

实际压测工具集成展示(tcp连接监控):
工具实际连接

看了些源码,原因可能是这里。不知道是否有后续解决方案?

// TODO: Since locust 2.0, spawn rate and user count are both handled by master.
// But user count is divided by user classes defined in locustfile, because locust assumes that
// master and workers use the same locustfile. Before we find a better way to deal with this,
// boomer sums up the total amout of users in spawn message and uses task weight to spawn goroutines like before.

@myzhan
Copy link
Owner

myzhan commented Aug 30, 2022

有关联,但跟你理解的可能不一样。

  1. locust 阶梯式变化的是并发数,不是负载,落到 boomer 这边,是用 goroutine 实现。
  2. 目前在实现递增的时候,会先关掉之前的 goroutine,但不一定能及时反映在连接数的变化上。你可以理解为这些连接还存在,但是实际并发在工作的,没有这么多。
  3. 后续在完善递增和递减的时候,确实可以做的更平滑一点,不用全关再全开,就是我在注释里面留的 TODO。

@daocoder2
Copy link
Author

平滑对用户数进行调度,在httprunner中有个版本的实现,可以借鉴下,不过对已有的改动比较大。

@myzhan
Copy link
Owner

myzhan commented Aug 31, 2022

主要的问题不是平滑,而是 locust 下发的消息里面,是根据 locustfile 声明的 class 名来分配的,这样就要求 locustfile 和 boomer Task 里面声明的一致了,使用起来不方便。我想先改 locust,将从 locustfile 读改成从 client ready 消息读。

@myzhan
Copy link
Owner

myzhan commented Oct 24, 2023

目前已经实现。

@myzhan myzhan closed this as completed Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants