How to generate LA?

Published on Author admin
How to generate LA
How to generate LA

How to generate LA?

Sometimes you need to simulate load on your server to check system behavior under heavy load. My case was to check scalability script that monitors backend load and creates new hosts in Digital Ocean. Previously I wrote the article about Load Average and the meaning of this metric. Here you can find that note. But there is still a question: How to generate LA?

So, you can try to simulate load with:
– CPU calculations. It can be done with some math operations
– I/O. In this case you need to stress your HDD(not a good idea at all)
– Network activity. (iperf can probably help)

Searching fast solution I came across stress. Stress(official page) is a deliberately simple workload generator for POSIX systems. It imposes a configurable amount of CPU, memory, I/O, and disk stress on the system. It is written in C, and is free software licensed under the GPLv2. Easy to install and no dependencies:

FreeBSD:
pkg install stress

Debian:
sudo apt-get install stress

CentOS:
sudo yum install stress

Example:
stress --cpu 8 -timeout 10s