Locust Directory

Testing webserver vs web app

Generating load on the webserver as opposed to the web application

Overview

Sometimes you want to test the maximum requests per second your webservers can deliver, as opposed to the dynamic content your application can - e.g. php, Laravel, etc.

To do that you can request only static content from the webserver, or even a very small static text file.

Here is an example with an image and robots.txt:

Code

from locust import HttpUser, task, between

class QuickstartUser(HttpUser):
    wait_time = between(4, 7)

    @task(1)
    def robots_fetch(self):
        self.client.get("/robots.txt")

    @task(1)
    def image_selection(self):
        self.client.get("/images/logo.jpg")
This guide is part of the LoadForge Directory, an index of locustfile's for use with LoadForge website and API load tests. We also provide a wizard to generate tests, and onboarding assistance for clients. Contact us should you have any questions.

LoadForge provides load testing and stress tests for websites, APIs and servers. It uses your cloud account to rapidly scale large numbers of simulated users to load test your website, store, API, or application for cheap - just cents per test!

Ready to run your test?
Start your first test within minutes.