Locust 官方文档 7:以逐步加载模式运行

--step-load 在 Locust 1.3 版本中已弃用

If you want to monitor your service performance with different user load and probe the max tps that can be achieved, you can run Locust with Step Load enabled with --step-load:

如果你想要用不同的用户负载,来监视服务性能并探究可以达到的最大 tps,你可以使用逐步加载的方式来运行 Locust。

你可以通过 --step-load 参数实现逐步加载:

$ locust -f locust_files/my_locust_file.py --step-load

Options

--step-load

Enable Step Load mode to monitor how performance metrics varies when user load increases.

启用 “逐步加载” 模式以监视用户负载增加时性能指标的变化。

--step-users

Client count to increase by step in Step Load mode. Only used together with --step-load.

在“逐步加载”模式下,User 数量逐步增加。仅与 --step-load 一起使用。

--step-time

Step duration in Step Load mode, e.g. (300s, 20m, 3h, 1h30m, etc.). Only used together with --step-load.

逐步加载模式的持续时间,比如(300s, 20m, 3h, 1h30m, 等)。仅与 --step-load 一起使用。

Running Locust in step load mode without the web UI

If you want to run Locust in step load mode without the web UI, you can do that with --step-users and --step-time:

如果要在没有 Web UI 的情况下以逐步加载方式运行 Locust,则可以使用 --step-users--step-time 来完成:

$ locust -f --headless -u 1000 -r 100 --run-time 1h30m --step-load --step-users 300 --step-time 20m

Locust will swarm the clients by step and shutdown once the time is up.

Locust 会逐步加载用户,并在持续时间结束是全部关闭

使用逐步加载的模式进行分布式运行

If you want to run Locust distributed in step load mode, you should specify the --step-load option when starting the master node, to swarm locusts by step.

如果你想在分布式模式下使用逐步加载模式,你需要在主节点机器指定 --step-load

It will then show the --step-users option and --step-time option in Locust UI.

将在 Locust UI 上显示 --step-users--step-time 选项。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容