Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Odoo load balancing using locust

98 views

Published on

Locust is an easy-to-use, distributed, fresh open source performance framework written in Python. It is intended for load-testing websites (or other systems) and figuring about how many concurrent users a system can handle. It is based on the MIT license.

Locust stress Odoo with maximum concurrent users. Locust has a neat and beautiful web interface enabling users to monitor the request failure rate (percentage) at different load levels. Also, it provides three basic graphical representations for Total Request per second, Response Time (ms) and Number of users. The failure exception logs are also available in locust UI. After finishing a test, the user can download CSV files for Request Statics, Response time Distribution and Exceptions.

Published in: Business
  • Be the first to comment

  • Be the first to like this

Odoo load balancing using locust

  1. 1. www.cybrosys.com Odoo Load Balancing using Locust
  2. 2. INTRODUCTION • Locust is an easy-to-use, distributed, fresh open source performance framework written in Python. It is intended for load-testing websites (or other systems) and figuring about how many concurrent users a system can handle. It is based on the MIT license. • Locust stress Odoo with maximum concurrent users. Locust has a neat and beautiful web interface enabling users to monitor the request failure rate (percentage) at different load levels. Also, it provides three basic graphical representations for Total Request per second, Response Time (ms) and Number of users. The failure exception logs are also available in locust UI. After finishing a test, the user can download CSV files for Request Statics, Response time Distribution and Exceptions.
  3. 3. • Configuration of Locust with Odoo 1. Install locust, Odoo Locust and other dependencies :  It is better to run locust with python 2.7. Python 3 has some issues with Odoo Locust package and its dependencies. pip install locustio OdooLocust openerp-client-lib
  4. 4. 2. Create your test with locust Here I am stressing odoo with two simple tasks. A. Read Partner ID’s B. Read Product ID’s Here is the seller_taskset.py file
  5. 5. Note: 1) @task takes an optional weight argument that can be used to specify the task’s execution ratio. In the above example, task1 will be executed twice as much as task2 2) max_wait = 1000 Maximum weighting time between the execution of locust task 3) min_wait = 100 Minimum weighting time between the execution of locust task 4) TaskSet class defines the execution behavior of this locust 5) weight = 3 The probability of locust being chosen. The higher the weight, the greater is the chance of being chosen.
  6. 6. 3. Run seller_taskset.py file by locust -f seller_taskset.py Seller
  7. 7. • Now got to 127.0.0.1:8089 on any web browser. • In the above interface, locust needs two inputs to start stressing odoo.
  8. 8. 1. Amount of users to simulate 2. Hatch rate: how quickly want to spawn the users Example: "Number of users to simulate" = 30 "Hatch rate" (user spawned / second) = 3 • When we start the load test with this configuration, locust will spawn 3 new users for every second until it fulfills the total number of users to simulate (which is 30 in this case). After 10 seconds, you will have a swarm of 30 simulated users. • To control the no. of request per second, you will need to set the max_wait accordingly.
  9. 9. • Locust test for the above example is given below.
  10. 10. Refer this link for more : https://www.cybrosys.com/blog/odoo-load-balancing-using-locust
  11. 11. Thank You ! Cybrosys Technologies Pvt. Ltd. Neospace, Kinfra Techno Park, Kakkancherry, Calicut University P.O. Calicut Kerala, India - 673635. Cybrosys Ltd 15, ST Antonys Road, Forest Gate, London England, E79QA. Cybrosys Technologies Pvt. Ltd. 1st Floor, Thapasya Building, Infopark, Kakkanad, Kochi, Kerala, India-682030.

×