How To Benchmark Ubuntu Server Performance

By Raman Kumar

Updated on May 18, 2025

In this tutorial, we'll learn how to benchmark ubuntu server performance. 

We recognize that maintaining high-performance Ubuntu servers is essential to providing reliable hosting services. Regular benchmarking helps ensure our servers run smoothly, handle peak traffic gracefully, and remain resilient under stress. This detailed guide explores essential benchmarking tools, how to install them, run tests, and interpret the results effectively.

Why Benchmarking Matters

Benchmarking enables us to measure the performance and stability of servers accurately. It helps in identifying bottlenecks, assessing the impact of upgrades, and validating server readiness for production workloads.

Prerequisites

  • A Ubuntu 24.04 installed dedicated server or KVM VPS.
  • A root user or normal user with administrative privileges.
  • Basic Linux command knowledge.

How To Benchmark Ubuntu Server Performance

Here, we focus on three widely-used, industry-standard benchmarking tools for Ubuntu:

Sysbench – CPU, Memory, and Database Benchmarking

Sysbench is versatile and helps measure CPU, memory, disk I/O, and database performance.

Installation

On Ubuntu 24.04 server, run the following command:

sudo apt update
sudo apt install sysbench -y

Benchmarking CPU Performance

To perform a CPU benchmark, we typically use the cpu test, which calculates prime numbers.

Run the following command to test CPU performance with 4 threads for 60 seconds:

sysbench cpu --cpu-max-prime=20000 --threads=4 run

Interpreting CPU Results

Sysbench will output metrics including:

  • Total time: How long the test ran.
  • Events per second: Measures throughput (higher means better performance).
  • Latency: Average response time (lower is better).

A higher event-per-second count indicates a more efficient CPU.

Benchmarking Memory Performance

Run this to test memory performance:

sysbench memory --memory-block-size=1M --memory-total-size=10G run

This tests how fast memory operations (read/write) are executed.

Database Benchmarking with Sysbench (MySQL/MariaDB)

First, create a database named test_db and a user with appropriate permissions. Then run:

sysbench /usr/share/sysbench/oltp_read_write.lua \
    --db-driver=mysql \
    --mysql-user=root \
    --mysql-password=yourpassword \
    --mysql-db=test_db \
    --tables=10 \
    --table-size=100000 prepare

sysbench /usr/share/sysbench/oltp_read_write.lua \
    --db-driver=mysql \
    --mysql-user=root \
    --mysql-password=yourpassword \
    --mysql-db=test_db \
    --tables=10 \
    --table-size=100000 \
    --threads=4 \
    --time=120 run

sysbench /usr/share/sysbench/oltp_read_write.lua \
    --db-driver=mysql \
    --mysql-user=root \
    --mysql-password=yourpassword \
    --mysql-db=test_db \
    cleanup

Interpreting Database Results

Important metrics include:

  • Transactions per second (TPS): High TPS indicates better database performance.
  • Latency: Lower values mean faster query execution.

IOzone – Disk I/O Benchmarking

IOzone measures disk performance, crucial for database and file server workloads.

Installation

Run this to install IOzone:

sudo apt update
sudo apt install iozone3 -y

Performing the Disk I/O Test

Here's how we perform a disk write/read test for a 1GB file:

iozone -a -g 1G -i 0 -i 1
  • The -i 0 tests write speeds, and -i 1 tests read speeds.
  • Interpreting IOzone Results

The primary indicators from IOzone are:

  • Write and read speeds (MB/s): Higher numbers indicate faster storage.
  • Disk throughput figures highlight potential storage bottlenecks.

ApacheBench (ab) – Web Server Performance Testing

ApacheBench is a standard tool to evaluate web server responsiveness under simulated traffic.

Installation

ApacheBench is bundled with Apache HTTP Server utilities. Install it via:

sudo apt update
sudo apt install apache2-utils -y

Running a Webserver Benchmark

To simulate 1000 requests to our server (example.com) with a concurrency level of 10, execute:

ab -n 1000 -c 10 http://example.com/

Interpreting ApacheBench Results

Key metrics provided include:

  • Requests per second: Reflects the server’s capability to handle traffic.
  • Time per request: How quickly the server processes requests (lower is better).
  • Transfer rate: Indicates network throughput.

For web hosting, higher requests per second and lower latency indicate superior performance.

Understanding the Benchmark Results – What to Look For?

When we perform server benchmarks, we primarily look at these key metrics to assess performance:

1. CPU Performance

What We Check:

  • Events per Second (Throughput): Indicates how many operations the CPU can handle per second.
  • Latency (Response Time): Measures how quickly the CPU processes tasks.

Good Performance Values:

Events per second: A higher number indicates better performance. On a typical mid-range server, a Sysbench CPU test may yield thousands of events per second. For instance, 3000+ events/sec is considered excellent for general-purpose web hosting.

Latency: Lower latency (e.g., under 1 millisecond per operation) indicates more efficient CPU performance.

2. Memory Performance

What We Check:

  • Transfer Speed (MB/sec): Reflects how fast data moves to and from memory.
  • Latency: How quickly memory responds to read/write operations.

Good Performance Values:

Transfer Speed: Higher is always better. A typical modern server with DDR4 RAM should exceed at least 5000 MB/s. Performance above 10,000 MB/s indicates exceptional memory speed.

Latency: Ideally, memory latency should remain low, typically well under a millisecond for memory operations.

3. Disk I/O Performance

What We Check:

Read/Write Speeds (MB/sec): Indicates how quickly the server can read from and write data to its storage.

Good Performance Values:

HDD (Spinning Drives): Around 100-200 MB/sec is standard; 250+ MB/sec indicates above-average performance.

SSD Drives: Typical good performance values range from 400 MB/sec to well over 1,000 MB/sec. High-quality NVMe SSDs can surpass 2,500 MB/sec read/write speed, indicating excellent performance for database-heavy workloads.

4. Database Performance

What We Check:

  • Transactions per Second (TPS): How many database transactions the server handles per second.
  • Average Query Latency: Time taken for each query.

Good Performance Values:

TPS: Typically, hundreds to thousands of transactions per second. For instance, 500 TPS is solid for smaller to medium-sized web applications. Values above 1,000 TPS signify robust database performance.

Latency: A lower latency, typically less than 5 milliseconds per query, is ideal.

5. Web Server Performance (ApacheBench)

What We Check:

Requests per Second (RPS): The rate at which our server can handle HTTP requests.
Time per Request: Indicates how fast the web server responds.

Good Performance Values:

RPS: For shared hosting or small VPS, values around 100-500 RPS indicate good performance. For dedicated or high-end VPS, 1000+ RPS suggests excellent performance.

Time per Request: Ideally below 100 ms; consistently below 50 ms is excellent performance, indicating fast, responsive server behavior.

How to Interpret Results Practically?

  • Higher throughput values (events/sec, requests/sec, TPS) always indicate stronger performance.
  • Lower latency or response times show efficiency and quicker task processing.
  • If results consistently fall below expected thresholds, consider server upgrades or performance tuning.

Essential Metrics to Monitor Regularly

Regular benchmarking allows us to watch these critical server metrics:

  • CPU utilization and throughput
  • Memory access speed
  • Disk I/O performance
  • Database transaction efficiency
  • Web server response time and scalability

This holistic approach ensures optimal server health and customer satisfaction.
Best Practices for Effective Benchmarking

To achieve accurate benchmarks, we recommend:

  • Running tests multiple times and averaging results.
  • Conducting tests during off-peak hours to avoid interference from regular traffic.
  • Comparing results after server upgrades or configuration changes.
  • Documenting results regularly for historical comparisons.

Conclusion

Benchmarking our Ubuntu servers using tools like Sysbench, IOzone, and ApacheBench gives us actionable insights into server performance. By regularly monitoring key metrics, we maintain superior hosting services that are reliable, fast, and ready for any challenge.

By following the detailed steps above, we empower ourselves to identify performance bottlenecks early, enabling proactive server management and providing an unmatched hosting experience.