Neoncube
MediaTech
How do you test whether your system, worth millions, can handle millions? Load testing with Locust.io
Published on 13/08/2024

In MediaTech, where every second of downtime can cost thousands, load tests play a key role. They make it possible to ensure the reliability of systems. At Neoncube, we take on the challenge of certifying traffic and verifying system performance for our customers. How do we verify that systems worth millions are ready to handle millions of users? We explore load testing.

Every second counts: the role of load testing

Imagine a streaming platform that is preparing for the premiere of a series. A promotional campaign has been running for several weeks in many countries. Estimated traffic on the day of the premiere is 50 million users. Premiere time arrives. The servers cannot handle the load. The streaming platform stops working. One mistake costs millions - not only in terms of money, but also in terms of user dissatisfaction.

Load tests are designed to check system performance under standard or maximum load. This process identifies bottlenecks, any delays, errors or failures. In addition, it makes it possible to assess stability in the case of a heavy load over an extended period of time.

This means that load testing answers two key questions:

  • What load is our system currently able to withstand?
  • What load is our system able to withstand if we modify the infrastructure?

By testing the system, it is possible to diagnose needs such as the need to add a server, increase the capacity of a database or other component.

Security for the MediaTech industry – traffic certification

The reliability of systems in the MediaTech industry often determines the success of the entire project and the return on investment. Load testing becomes part of traffic certification in this case. This is a special contract that obliges the system provider to support a specific number of users within a certain time period. The parameters can vary depending on the specifics of the software. Traffic certification is an additional safeguard that mitigates the risk of system performance problems.

Closed
Preparing the system for the traffic of one million users
P
Prostreamin10 days ago

Prerequisites

✅ We are preparing to launch a contest on our platform, which will bring increased traffic. We are planning an additional advertising campaign on television and websites to encourage people to enter our service at a specific time.

✅ Traffic can reach up to one million users, which has not been the case until now.

Description of the problem

We need to prepare for increased traffic on the site. We want to perform load tests and eliminate possible bottlenecks. What tools do you recommend?

R
Ryan10 days ago

PFLB - geographically distributed load, 300,000 XNUMX RPS, integration with JMeter, performance reports. I recommend

S
Skyc10 days ago

Kobiton with additional AI-based features, integration with JMeter

P
Prostream9 days ago

We want to test the system in Python. Any additional suggestions?

Neoncube9 days ago

We have decided to load test in Python with locust.io. It is possible to replace any component or use any piece of code in Python and work with locust almost instantly. It can also handle testing the indicated traffic.

P
Prostream9 days ago

I can do everything in code, yes? And this is a proven tool?

Neoncube9 days ago

Yes, everything is based on simple code in Python. You don't need to design user interfaces or XML code. We used Locust in large-scale load testing. We simulated the traffic of millions of users simultaneously. It worked perfectly.

How to create load tests in Locust.io?

The basis for creating load tests in the Locust.io area is the traffic requirements obtained from the customer. They can be in the format:

  • general availability - parameters that the system must handle always, every day at any time,
  • per event - that is, for example, requirements for serving a specific number of users at a specific time on a particular day - the system must serve 500,000 users between 7pm and 10pm, December 13.

We then perform a preliminary requirements analysis and design test scenarios based on the information obtained.

Important! Test scenarios must be as close as possible to what the user does when using the system. An example session might look like the following: logging in, viewing the user's profile, navigating to two subpages and completing a purchase.

The designed test scenarios are deployed using Locust on the corresponding test infrastructure. This consists of traffic-generating test servers and a staging version of the system (as close to a live environment as possible).

The load tests are then run. The next steps in the process involve analyzing what is happening to the infrastructure. Depending on the situation, iterative modifications are made:

  • infrastructure, for example adding servers, increasing the power of components such as cache or databases,
  • applications, if there are errors or inadequate integrations with infrastructure components have occurred.
P
Prostream9 days ago

Can you show me the interface and reporting via locust?

Neoncube8 days ago

On locust's site you have a code example that can be implemented for load testing

py
from locust import HttpUser, between, task

class WebsiteUser(HttpUser):
    wait_time = between(5, 15)

    def on_start(self):
        self.client.post("/login", {
            "username": "test_user",
            "password": ""
        })

    @task
    def index(self):
        self.client.get("/")
        self.client.get("/static/assets.js")

    @task
    def about(self):
        self.client.get("/about/")

locus example screenshot 1locus example screenshot 2locus example screenshot 3

P
Prostream8 days ago

Thanks! I will use

3 reasons why we chose Locust.io for load testing

We decided to use this tool for 3 reasons:

  • It is designed to be scalable and flexible, which means that any component can be replaced or any piece of code written in python can be used, adapting it to work with locust almost instantly.
  • Locust supports distributed mode, which allows us to run tests on more than one server. This capability is invaluable when testing traffic in the order of tens of thousands to millions.
  • Locust also provides an interface that we can change in real time the test parameters (number of simulated users, traffic distributions) with the help of a simple UI.

Ok, let’s talk business

Contact us and we will schedule a call to discuss your project scope, timeline and pricing.