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.

Simulating multiple independent user web behaviour

See original GitHub issue

Hi

I am studying the Locust package to see whether it would support the simulation of multiple independent user web usage (visiting sites, file upload/download/streaming) in an office IT environment enabled via managed cloud servers.

The idea is we have different types of user profiles which represent different usage patterns - some users might just browse multiple sites in a session, without much in the way of direct data transfer, some might do a lot of streaming or downloading, some browsing randomly but uploading periodically, and other user profiles a mixture of these. I would like to use Locust to model these different types of user and the maximum number of users I have in mind is 300 or even 500.

At the moment it appears as if each Locust object gets a host attribute, which is fixed for all the tasks that this locust might define via the TaskSet class. But for a typical user I am considering they will, in a given session, use multiple sites simultaneously or in a sequence for browsing and/or file downloading/uploading/streaming. So it seems as if I need to have a TaskSet for a user which contains multiple tasks, each task needing a separate host for the duration of the task.

How would I go about doing this?

Thanks, Sandeep

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
srm4commented, May 3, 2016

I was missing the extra part of the full path, so http://example.com/test does show up as /test on the stats UI.

I think it would better if the full path name was displayed in the stats and maybe even the task method, as extra information. Would this be possible via a PR?

0reactions
srm4commented, May 3, 2016

I tried that but it doesn’t seem to work. Here is locustfile.py which I am testing on a local machine:

  1 from locust import HttpLocust, TaskSet, task
  2 from locust.clients import HttpSession
  3 
  4 class UserBehavior(TaskSet):
  5     
  6     def on_start(self):
  7         """ on_start is called when a Locust start before any task is scheduled """
  8         self.login()
  9     
 10     def login(self):
 11         self.client.post("/login", {"username":"user0001", "password":"Password"})
 12     
 13     @task(10)
 14     def example(self):
 15         self.client.get("http://example.com")
 16         
 17     @task(1)
 18     def index(self):
 19         self.client.get("/")
 20         
 21     @task(2)
 22     def ip(self):
 23         self.client.get("/ip")
 24         
 25     @task(5)
 26     def headers(self):
 27         self.client.get("/headers")
 28         
 29 class AUser(HttpLocust):
 30     host = 'http://httpbin.org'
 31     task_set = UserBehavior
 32     min_wait=5000
 33     max_wait=9000

As you can see all except one of the tasks in UserBehavior make requests against the host http://httpbin.org, which is set as host in AUser, but one of the tasks example makes a specific request to http://example.com. However the request stats from the UI don’t show any requests to http://example.com (screenshot attached).

locust-ui

Read more comments on GitHub >

github_iconTop Results From Across the Web

Features of Webserver Stress Tool - Paessler
Webserver Stress Tool simulates large numbers of users accessing a website via HTTP/HTTPS. The software can simulate up to 10.000 users that independently...
Read more >
Simulating Simple User Behavior for System Effectiveness ...
ABSTRACT. Information retrieval effectiveness evaluation typically takes one of two forms: batch experiments based on static test.
Read more >
Domain-independent User Simulation with Transformers for ...
In this work, we propose a domain-independent transformer-based user simulator (TUS). The structure of our TUS is not tied to a specific domain, ......
Read more >
(PDF) Modeling and simulation of individual user behavior for ...
The models are based on a well structured general model of five different domains of building entities, including user activities. Models for ...
Read more >
A Behavior Authoring Framework for Multi-Actor Simulations
The use of domain-independent planners [Fikes and Nilsson 1971] is a promising direction for automated behavior generation. Plan- ning approaches provide ...
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