当前位置:网站首页>Locust learning record I
Locust learning record I
2022-07-04 10:49:00 【weixin_ thirty-four million three hundred and twenty-two thousa】
Locust What is it? ?
Locust Is a relatively easy to use distributed user load testing tool
It's designed to ( Or other systems ) Load test , And determine how many concurrent users the system can handle ,Jmeter You can also deal with this scenario , But personal feelings Jmeter It's not as convenient as Locust major
Locust In English Chinese tense 【 grasshopper 】 It means :
The author's idea is , During the test , Put in a large group 【 grasshopper 】 Attack your website
Of course, the implementation can be used Locust Define each locust ( Or test users ) act , And through webUi Real time surveillance of the siege process
This will help you test and identify project bottlenecks before the project goes live
Locust It can make test engineers reply more professionally to developers and project managers :
You can imagine , When the project manager or leader asks you about the performance of the project , How much pressure can I bear ;
Your answer says that this project is in 2314 People visit at the same time , If you exceed that, you will hang up / Downtime / Make a mistake, etc , When in 1834 When people visit at the same time , It's going to slow down ; View of specific access time XXX
Does this answer seem to be more professional ?
Locust Operating principle
Locust The operation principle of is completely based on the event operation , So you can support thousands of concurrent users on one computer ;
Compared to many other event based applications , It doesn't use callbacks ( such as Nodesjs It belongs to callback ,Locust Do not use this logic )
contrary , He passed gevent【 coroutines 】 Use lightweight processes . Test that each locust on your site actually runs in its own process ( To be right , yes Greenlet)
This allows you to write python The code is simpler , Instead of going into something like JS The kind of callback region
Locust Characteristics of
use python Write a test plan
1. Don't need to UI Click foolishly on the interface , Just write the code normally
2.Locust Based on orchestration rather than callback , This will make your code similar to normal python Block code to execute synchronously
Distributed & Expand
1. Support simulation of hundreds of thousands of user behavior
2.Locust Support to run load tests on multiple computers ( You can run multiple machines in parallel )
3. Because based on events , Therefore, even a locust node can process tens of millions of users in a single process
4. But even if you simulate so many users , Not everyone is using your system at this frequency , Usually , Users will have time to think , Think about what to do next
Be careful !【 Requests per second 】 It's not equal to 【 Number of online users 】
The statistics are based on Web Interface
1.Locust There's a simple user interface , It can display relevant test details in real time
2. The statistical results interface is based on Web , Web pages are inherently cross platform , therefore Locust It's cross platform and easy to scale
Can test any 【 Webpage 】【 application 】【 System 】
1. Even if Locust It's for Web Of , It can test almost all projects
2. It only needs python Write the test method you want , And then put 【 grasshopper 】 Just execute the project that needs to be tested
Vulnerable to invasion
1.Locust The locusts released were very small , It's easy to be invaded , The development team has always intended to maintain this state
2. Time I/O All the heavy work of the project is entrusted to gevent
Locust Is completely based on python
http The request is entirely based on requests library ;
Locust Support http,https agreement , There's also support for other agreements ,webSocket etc.
Just use python Call the corresponding library
http/https use requests;
webSocket use webSocket;
Locust The creative background of
Locust Why create , It's because left and right are not satisfied with the existing performance testing solutions
The author believes that they have not solved the right problem , Failed to grasp the point
The author has tried Apache Jmeter and Tsung
Jmeter With one UI, Many people may think it's a good thing , Just a little bit ;
But through some click interfaces 【 code 】 Your test plan is a PITA
secondly ,Jmeter It's thread bound , This means that for every simulated user , All need a separate thread , This leads to , It is not feasible to simulate thousands of users on a computer for testing
On the other hand ,Tsung of no avail Erlang The thread problem of writing
It can take advantage of BEAM Lightweight technology provided by itself , And can happily expand the scale
But in defining the test plan ,Tsung and Jmeter Just as limited
It provides the basis XML Of DSL To define how users behave during testing ( This format is very Low, But it's intuitive ). When finished, display any kind of graphics and reports , You need to post process the logs generated by the test , That's the only way , You can understand how the test is conducted
Original address :Locust Tutorial - assi river
边栏推荐
- Sword finger offer 31 Stack push in and pop-up sequence
- How do microservices aggregate API documents? This wave of show~
- XMIND installation
- The future education examination system cannot answer questions, and there is no response after clicking on the options, and the answers will not be recorded
- Seven examples to understand the storage rules of shaped data on each bit
- Iterator generators and modules
- [Galaxy Kirin V10] [server] system partition expansion
- /*Rewrite the program, find the value of the element, and return the iterator 9.13: pointing to the found element. Make sure that the program works correctly when the element you are looking for does
- How to use diff and patch to update the source code
- system design
猜你喜欢

JMeter Foundation

Collection of practical string functions

2022 AAAI fellow release! Yan Shuicheng, chief scientist of sail, and Feng Yan, Professor of Hong Kong University of science and technology, were selected

Error C4996 ‘WSAAsyncSelect‘: Use WSAEventSelect() instead or define _ WINSOCK_ DEPRECATED_ NO_ WARN
![[test theory] test process management](/img/d2/65865dffacf38d9a8be720868b75f0.jpg)
[test theory] test process management

Tables in the thesis of latex learning

Virtual machine configuration network

Rhcsa learning practice

Delayed message center design

VI text editor and user rights management, group management and time management
随机推荐
Hlk-w801wifi connection
Add t more space to your computer (no need to add hard disk)
leetcode729. My schedule 1
VI text editor and user rights management, group management and time management
VLAN part of switching technology
Const's constant member function after the function; Form, characteristics and use of inline function
Basic data types of MySQL
Write a program to define an array with 10 int elements, and take its position in the array as the initial value of each element.
Deepmind proposed a Zuan AI, which specially outputs network attack language
Performance test overview
Introduction to tree and binary tree
Leetcode48. Rotate image
[Galaxy Kirin V10] [server] system startup failed
Rhsca day 11 operation
BGP advanced experiment
[Galaxy Kirin V10] [server] NUMA Technology
The most detailed teaching -- realize win10 multi-user remote login to intranet machine at the same time -- win10+frp+rdpwrap+ Alibaba cloud server
Occasional pit compiled by idea
Network connection (II) three handshakes, four waves, socket essence, packaging of network packets, TCP header, IP header, ACK confirmation, sliding window, results of network packets, working mode of
Talk about scalability