Web????????????????
?????writing for time ???????[ 2016/10/9 17:07:27 ] ????????WEB???? ???????
???????????????????????????????ab??locust??????
?????????????demo??Σ??????????????????????????????趨??500????20????
???????????
????ab
????ab??????Apache HTTP server benchmarking tool
????ab??apache????????????????ab??????????????????apache??????????????????????????????????????????????????????????????nginx??tomcat??IIS???
????locust
????locust??????????????????????python?????????????????
????locust??web ui???棬?????????????????????????
???????????
???????ab????
???????????????????????www.example.com
?????????????????????? /index
????ab -n 500 -c 20 https://www.example.com/ #500 ?????20 ????????n?????????????c?????????
??????????????????????ab??????????ο??? Web???????????????ApacheBench??ab?????
???????locust????
????locust?????python????????????pip????? pip install locustio ?????????? locust --help
??????????? ?????? ??д??????????
????vim locustfile.py
from locust import Locust?? TaskSet?? task
class MyTaskSet(TaskSet):
min_wait = 5000
max_wait = 15000
@task
def task1(self):
self.client.get("/")
'''
@task
def task2(self):
self.client.get("/index")
'''
class MyLocust(Locust):
task_set = MyTaskSet
????locust -f locustfile.py --host=http://www.example.com
??????????127.0.0.1:8089????????????
???????????????????п?????.??locust?д???session??????:
????The HttpSession instance will preserve cookies between requests so that it can be used to log in to websites and keep a session between requests.
??????

???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11