locustio / locust

Write scalable load tests in plain Python 🚗💨
https://locust.cloud
MIT License
25.1k stars 3k forks source link

logfile is erroniously written when there are many workers. #2927

Closed clint-qrypt closed 1 month ago

clint-qrypt commented 1 month ago

Prerequisites

Description

When using processes = -1 in the locust.conf file and 12 or more workers are running, the logfile is getting crushed by all the simultaneous writes. Data is being inserted in the middle of writes from other workers, and a lot of missing newlines.

Command line

locust

Locustfile contents

self.client.post(
   "/api/v1/entropy",
   name="entropy" + "/" + TEST_CASE.name,
   headers=self.headers,
   json=TEST_CASE.value,
   timeout=90,
)

#conf file
host = http://localhost    # uncomment this for local dev env testing
users = 300
spawn-rate = 25
processes = -1
csv = results/300VUs-32B-Soak-Test
only-summary = true
run-time = 36h
headless = true

Python version

3.10

Locust version

2.31.8

Operating system

Ubuntu 22.04

clint-qrypt commented 1 month ago

Screenshot 2024-10-07 at 8 09 37 AM

cyberw commented 1 month ago

I'm guessing you wouldn't want workers to write to the csv file at all and only have the master do it? I've added a fix for that, feel free to try it out.