question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Users are not distributed equally across workers.

See original GitHub issue

Describe the bug

Running locust in k8s across hundreds of workers, I peeked the workers UI tab and wondered why do some workers report to run several users, when most of the cluster is still not running a single user.

Expected behavior

I expected the users to be equally distributed across my workers

Actual behavior

I ran this test with 600 workers image

Steps to reproduce

I guess it reproduces with a high number of workers?

Environment

  • OS: k8s
  • Python version: locust latest official docker image
  • Locust version: locust latest official docker image
  • Locust command line that you ran: args: ["-f", "/loadtest/locustfile.py", "--worker", "--master-host", "locust-master"]
  • Locust file contents (anonymized if necessary):
from locust import HttpUser, task
import subprocess

class LoadTestUser(HttpUser):
    @task
    def do_test(self):
        urlfile = subprocess.check_output(["bash", "-c", "find /loadtest/urlfiles -type f | shuf | head -n 1"]).rstrip()
        with open(urlfile) as f:
            urls = [l.rstrip() for l in f.readlines()]
        for u in urls:
            self.client.get(u, verify=False)

Basically the test fetches a random url list for a single flow in our system, and probes all the URLs.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
guysvcommented, Jul 7, 2022

OK setting my cluster with pod affinity so every locust worker get a core and the master get a private node did the trick.

Closing the issue for now, although it looks like running workers in big numbers requires some tricks to the heartbeat mechanism.

0reactions
cyberwcommented, Jul 6, 2022

So obviously the master is conjested

well, I wouldnt be so sure, but it is very possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make Sure Your Team's Workload Is Divided Fairly
How do you make sure that work on your team is evenly distributed? What do you do about the person who's great at...
Read more >
Talent Is Equally Distributed, But Opportunity Is Not.
“There is a common saying that talent is equally distributed, but opportunity is not,” says Beth Mily, chief executive officer of Geekwise ...
Read more >
Unequal Power: How the assumption of equal bargaining ...
The assumption of equal power—the idea that if workers don't like a job, they are free to work elsewhere and this prevents exploitation—enables...
Read more >
Talent Is Equally Distributed, But Opportunity Is Not
Ultimately, we must come around to the idea that the talent among us is distributed equally, but the opportunity isn't. When we can...
Read more >
Q 18. Are U.S. unemployment rates dist... [FREE SOLUTION]
No, the unemployment rate is not distributed evenly in the US economy. ... we see across different groups of people based on gender,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found