Skip to content
Pinter Computing

Knowledge Base for IT Professionals, Teachers, and Astronauts

Pinter Computing

Knowledge Base for IT Professionals, Teachers, and Astronauts

  • Home
  • Programming
  • DevOps
  • Project Management
  • Software and Hardware
  • Miscellaneous
  • Egyebek
  • About
  • Experience
  • Education
  • Contact
  • Home
  • Programming
  • DevOps
  • Project Management
  • Software and Hardware
  • Miscellaneous
  • Egyebek
  • About
  • Experience
  • Education
  • Contact
Close

Search

Home/Knowledge Base/Locust installation and setup
Knowledge Base

Locust installation and setup

By Laszlo Pinter
October 17, 2023 2 Min Read
0

Installation

To install Locust, follow the instructions at Locust Installation

  • Create a directory for the Locust project
  • Create a subdirectory for the source code
  • Create a new Anaconda virtual Python environment. ( At the time of writing Python version 3.10 is the latest. )
    conda create -n locust python=3.10
  • Activate the new virtual environment
    conda activate locust
  • Install Locust
    pip3 install locust
  • Check the success of the installation
    locust -V

Troubleshooting

If the check fails with the error message


ValueError: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 152 from C header, got 40 from PyObject

Make sure you use the Anaconda virtual Python environment to avoid version conflicts between installed Python components.

Create your first test

See https://docs.locust.io/en/stable/quickstart.html for the Quick Start tutorial.

  • Create the test file
    locustfile.py
  • Specify the actions to be taken
import time
from locust import HttpUser, task, between

class QuickstartUser(HttpUser):
  wait_time = between(1, 5)

  @task(3)
  def view_items(self):
    # self.client.get(url + "/")
    self.client.get("/")

  @task
  def hello_world(self):
    # self.client.get(url + "/about")
    self.client.get("/about")


  def on_start(self):
    a = 0 # Just a placeholder, as every def has to have at least one executable instruction
    # No login is necessary for this site
    # self.client.post("/login", json={"username":"foo", "password":"bar"})

Starting Locust

  • Open a terminal in the directory where the locustfile.py is located.
  • Start Locust with
    locust -f locustfile.py
  • Open the web UI at http://localhost:8089/
  • Specify the number of concurrent users and the span rate of the users. Enter the URL of the site to be tested. IMPORTANT: Make sure there is no slash at the end of the URL, otherwise the generated URL will contain double slashes!!!
  • Click the Start swarming button.

Changing the load test script

To make sure, Locust will execute the updated script

  • Stop the Locust process in the terminal with CTRL-C
  • Modify and save the locustfile.py file
  • Start the Locust process with
    locust -f locustfile.py

Author

Laszlo Pinter

Follow Me
Other Articles
Previous

Returning trains do not follow the station list in Railway Empire 2

Next

Cities: Skylines II notes

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Last Changes

  • DevOps Engineering part 1. (Mac) - Make your Macintosh easier to use June 25, 2026
  • Japan travel tips June 22, 2026
  • How to stop the rain and snow in Cities: Skylines II June 20, 2026
  • Cities: Skylines II Developer Mode June 20, 2026
  • 'CSII_MANAGEDPATH' has incorrect path(s) when building Cities: Skylines II mod June 20, 2026

Tags

.NET .NETcore 3Dprinting ASP.NET Core AutodeskInventor AWS C# Chef cloud DevOps Docker EntityFramework Games Git Go iOS iPad iPhone iPod Java Kubernetes Linux MacOSX MSSQL MVC Node.js Packer PowerShell Python RDS RightScale Ruby security Splunk TeamCity Terraform TestKitchen Tomcat Ubuntu Vagrant VirtualBox VisualStudio Windows WordPress Xcode

Recent Comments

  • Zengei László on MyHeritage családfa exportálása és küldése emailben
  • Raúl Castillo on DynDns update error
  • MICHAEL on Windows Media Player 12 cannot find the album information
  • Nargis on Configure Epson ET-3850 scanning on Windows 11
  • Venczelné Zemen Erika on Delta S2302 termosztát programozása

–

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Copyright 2026 — Pinter Computing. All rights reserved.