随笔 - 230  文章 - 0 评论 - 0 阅读 - 88402
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

locust是使用python的一种测试工具;注意python3最好在3.8以上较好。

首先要有python3的安装。

》pip3 install locust --timeout=12000

※ 有时安装过程较长,可添加 --timeout设置时间变长。中途会断,需要多次尝试。如果ssl没权限,则需要查看python安装ssl部分。

pip3 install locust --timeout=12000  -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

官网地址:https://docs.locust.io/en/stable/installation.html

                 

 

※ 异常:gcc: error trying to exec 'cc1plus': execvp: No such file or directory

缺少c++包,或gcc和g++版本不一致。可查看

>gcc -v

> yum install gcc-c++

 

参照官网示例:https://docs.locust.io/en/stable/quickstart.html

但是页面的8089默认使用的localhost,而非127.0.0.1,只能用localhost访问。对于测试机发布在页面查看,在启动参数添加:

》 --web-host=172.20.48.72 --web-port=8076

因locust默认会占据单个cpu,因此要在多核上使用,则需要启用master和工作worker

》nohup locust -f mytest.py  --web-host=172.122.33.44 --web-port=8076 --master &

》nohup locust -f mytest.py  --web-host=172.122.33.44 --web-port=8076 --worker &(根据需要可多添加)

 

posted on   zhaoqiang1980  阅读(122)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
历史上的今天:
2018-02-01 Java Enum
点击右上角即可分享
微信分享提示