locustio / locust

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

RPS vs Total Running Users #2895

Closed antikilahdjs closed 2 months ago

antikilahdjs commented 2 months ago

Prerequisites

Description

Hello,

I am sorry to ask it but I am so confusing about RPS vs Users (Concurrent). I am new using Locust and I fired as example 150 concurrent users plus ramp up 150 but the RPS is not the same as total of users. If the user requesting from API is 150 the number of RPS should be 150 too or am lost in something else?

Could you please guys help me on it?

image

Command line

I am using Kubernetes and I choose via UI the ramp 150 and concurrent 150

Locustfile contents

from locust import HttpUser, TaskSet, task, between

class TaskSet(TaskSet):

    def on_start(self):
        self.token = "$TOKEN"
        self.headers = {
            "Authorization": f"Token {self.token}"
        }

    @task
    def test_lab_api_performance(self):
        self.client.get(
            url="",
            headers=self.headers,
            verify=False
        )

class User(HttpUser):
    tasks = [TaskSet]
    wait_time = between(0.1, 0.2)

    def _init_(self, parent):
        super()._init_(parent)
        self.host = "https://mylab.com"

Python version

3.11.9

Locust version

2.31.5

Operating system

RHEL 8.5

cyberw commented 2 months ago

Hi!

In short: No, 150 users in no way guarantees 150 rps, it all depends on the response times of your system. And ramp up has no impact at all on the peak load, it only changes how quickly the 150 users are spawned.

Have a look at this article and see if it clears it up for you: https://www.locust.cloud/blog/closed-vs-open-workload-models

antikilahdjs commented 2 months ago

Hello @cyberw

I really thank you and I will check it out.