Python-based performance load test Locust-1 introduction

Source: Internet
Author: User

Official website: http://locust.io/
Github:https://github.com/locustio/locust

Brief introduction

Locust is an open source load testing tool. Use Python code to define user behavior, or to simulate millions of users.
Locust is a very simple to use, distributed, User load testing tool. Locust is primarily a load test for websites or other systems that can test how many users a system can handle concurrently.
The Locust is completely time-based, so a single machine supports thousands of concurrent users. Compared to many other event-driven applications, Locust does not use callbacks, but uses lightweight processing gevent.

Characteristics
    • Write user test scenarios using pure Python code; UIs or XML is not required
    • Distributed & Scalable-supports thousands of users
    • Web-based UI
    • Can test any system, although Locust is Web-oriented, but can also test any other system

# #安装:

pip install locustio

# #示例代码:

from locust import HttpLocust, TaskSet, taskclass WebsiteTasks(TaskSet):    def on_start(self):        self.client.post("/login", {            "username": "test_user",            "password": ""        })    @task    def index(self):        self.client.get("/")    @task    def about(self):        self.client.get("/about/")class WebsiteUser(HttpLocust):    task_set = WebsiteTasks    min_wait = 5000    max_wait = 15000
Other information

Python Module Introduction-locustio: Performance testing tools Locustio Chinese documents

Background

We have studied existing solutions that are not in line with the requirements. Like Apache JMeter and Tsung. JMeter is UI-based and easy to get started with, but the configuration of the test scenario via the UI click makes it out of programming fun. Second jmeter based on threading, it is almost impossible to simulate thousands of users. Tsung is based on Erlang, which can simulate thousands of users and is easy to scale, but it is an XML-based DSL that describes the scenario as weak and requires a lot of data processing to know the test results.

In any case, we try to solve these problems through Locust, hoping that none of the above problems will be a locust pain point.

Maybe you'll say we're trying to scratch the itch. I hope other people like us think it's a meaningful thing.

Author
    • Jonatan Heyman (@Jonatanheyman on Twitter)
    • Carl bystr?m (@cgbystrom on Twitter)
    • Joakim Hamrén (@Jahaaja on Twitter)
    • Hugo Heyman (@Hugoheyman on Twitter)

Python-based performance load test Locust-1 introduction

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.