Locust 官方文檔 7:以逐步加載模式運行

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 選項。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章