reqs/sec not correct when load testing with Python Locust

一个人想着一个人 提交于 2019-12-23 05:45:12

问题


In my testing, both min_wait and max_wait are set to 1 second, and I set users to 100, so I expect the reqs/sec to be close to 100.

I know Locust actually need to wait server respond and then send the next request. Even though, if server respond quick, like 20ms, the outcome TPS should be close to 100, like 92 maybe.

But, in actuality it is 10, as the following picture shows:

What am I missing?

My code is below:

class UserBehavior(TaskSet):   

    @task(1)
    def list_teacher(self):
        self.client.get("/api/mgr/sq_mgr/?action=list_teacher&pagenum=1&pagesize=100")

    @task(1)
    def list_course(self):
        self.client.get("/api/mgr/sq_mgr/?action=list_course&pagenum=1&pagesize=20")


class WebsiteUser(HttpLocust):
    task_set = UserBehavior
    min_wait = 1000
    max_wait = 1000

来源:https://stackoverflow.com/questions/53753703/reqs-sec-not-correct-when-load-testing-with-python-locust

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!