How to stress test a web application

November 18, 2018

Lang: cs en de es

Having a web app is nice. But the application must also be easy to use. The basic thing is that the web application should load as fast as possible. Therefore, we need to test how fast the web page loads and how fast the server and web application can handle a large number of concurrent users.

Speed test

When it comes to web page speed, the basic thing to test is the speed of loading and displaying a web page

So you need to test the application. You can do a basic test by viewing the selected web page in your browser. You can also view the developer information to see in more detail which parts of the page load and display in what time.

Another option is to use web applications that test the loading speed of your website and display the results:

Stress Test

This test can also be called burn test or stress tets.

However, you will be interested in how your web application performs in real traffic, i.e. when multiple users access the site, which can sometimes be many. Therefore, you need to stress test your web application by simulating a situation where the web application is used simultaneously by many users.

Why perform a stress test? It will test the response of the application in a situation close to real use and thus verify that:

  • the application is well written
  • the web server is well configured
  • the web server is sufficiently oversized
This prevents you from running out of system resources on, for example, a weak server during a default installation and web server crashes.
And thus the visitor will be happy to use your web application.

To stress test a web application, use the utility AB, which accesses a given web site and simulates many users accessing it in parallel.

The main parameters of the AB program are set by switches:

  • n - specifies how many connections the program should perform.
  • c - specifies how many parallel connections to make.
So the bigger c the bigger the load for the server.
Usage example:
ab -n 100 -c 25 https://www.domena.cz

Performance

When it comes to application performance, i.e. the speed of an application given a combination of all possible influences, the following parameters affect the speed of a web application:

  • Programming language, its version
  • Database
  • Program quality
    • program on the server (PHP, Python, Java)
    • client-side program (JavaScript)
  • Data storage
  • Web server configuration
  • Database configuration
  • Server hardware performance
  • Network speed and quality
From a performance perspective, it is of course ideal to have your own virtual server. For example, with the software ISP Config you can conveniently manage it yourself.

Handbook

Video demonstration on how to test the speed of a web application under load:

Results

And here are the real tests of a few of my sites and a sample wordpress that I exported to a chart:

josefjebavy.cz-benchmark
/josefjebavy.cz-timeseries.jpg

/maps.xeres.cz-benchmark.png
maps.xeres.cz-timeseries.jpg

wireless.xeres.cz-benchmark.png
wireless.xeres.cz-timeseries.jpg

worpress.xeres.cz-benchmark.png
worpress.xeres.cz-timeseries.jpg

Customized tests

If you want to test your site speed or run a stress test feel free to reach out I am available. I also perform other analyses according to the customer's needs.

Articles on a similar topic

VMware vs Proxmox: performance comparison
GitLab CI/CD: test automation and application deployment
Migrating VPS from VMware to Proxmox
VMware licensing change
Running Microsoft SQL Server on Linux
Backup: the Proxmox Backup Server
Linux as a router and firewall
How to upload a docker image to the Docker Registry
Linux: logical volume management
Linux Software RAID
Running a web application behind a proxy
Mailbox migration
Docker multistage build
Backing up your data by turning on your computer
Podman
Importing Windows into Proxmox virtualization
Docker and PHP mail
Proxmox virtualization
Docker and Cron
Lenovo ThinkPad X1 Carbon: LTE modem EM7544 commissioning
Yocto Project: Build custom operating system for embedded devices
Preparing a Linux server to run a web application in Python
How to address poor file share performance in Docker
How to get started using Docker correctly
Installing Linux on a dedicated HPE ProLiant DL320e server
Why use the JFS filesystem
How to boot from a 4TB drive with GTP using UEFI
Btrfs file system
Raspberry PI
WINE - running Windous programs under Linux
GNU/Linux operating system

Newsletter

If you are interested in receiving occasional news by email.
You can register by filling in your email news subscription.


+