-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simulating real browser behaviour #120
Comments
Hi! Scaling up the serving of static files is very simple compared to scaling up a dynamic website. Also, high traffic websites often use some kind of CDN for static files. If not a CDN, a load balancer with a couple of nginx machines should be able to handle A LOT of traffic. Locust focuses on simulating the traffic from dynamic requests. You could make Locust load static files by parsing responses and then issuing new calls to client.get(), but since the serving of static content should be totally separated from dynamic requests, I would recommend to have a separate load test that tests static files. |
Hey, Techniques of scaling up the serving of static files or dynamic components have nothing to do with the task of load testing. More, some of the linked resources in HTML might require computation on the server side so could be considered dynamic. More, serving static content will consume CPU and bandwidth which can have significant effect on the server's efficiency in relation to dynamic content, so it would appear that you can't simply focus on dynamic parts without considering static parts. Also, resources such as CDN or a couple of nginx machines don't come for free so their availability should not be taken by granted. I think these are some strong assumptions you make about how people should build their apps or what they can afford. Perhaps this is something you will want to consider. It would be fantastic to see such functionality in locust. Thanks for taking time to respond, I appreciate it. |
Then you should write locust tasks for them. There are a multitude of other tools that are suitable for loadtesting static content, and you can run them at the same time as you run a locust test. The strength of Locust is to fetch dynamic content and act on the response. However, using BeautifulSoup to fetch all images/css/js from every HTML-response in your Locust test and download those should be fairly trivial to implement yourself. |
@mthurlin We also want to load test something that will be hit by real browsers, so we need this functionality too. I just researched on this, and it would require implementing all Therefore, this seems to be a real gap of locust and I recommend reopening this ticket and reconsidering putting something in like this eventually, even if it's just a beautifulsoup script as some sort of contrib resource which people can reuse. |
This page has a lot of helpful info for doing this and more |
Hi all, Any update? |
Hey,
A real browser will download not only the content of the page but also all js scripts, css, images etc. I was wondering how this is supported in locust. All those extra resources can easily amount for most of the web traffic but also server's ability to handle simultaneous users. It seems to me, however, that locust's (or requests') get gets only the main content. Is this the case? If so, how accurate are the locust measures when predicting real-life performance of your setup?
Thanks,
The text was updated successfully, but these errors were encountered: