Docs / Performance Optimization / Benchmarking VPS Performance with sysbench

Benchmarking VPS Performance with sysbench

By Admin · Jan 22, 2026 · Updated Apr 23, 2026 · 6 views · 3 min read

Benchmarking VPS Performance with sysbench is a common requirement for VPS administrators. This guide provides practical instructions that you can follow on Ubuntu 22.04/24.04 or Debian 12, though most steps apply to other distributions as well.

Prerequisites

  • A VPS running Ubuntu 22.04 or later (2GB+ RAM recommended)
  • Basic familiarity with the Linux command line
  • Current baseline performance metrics for comparison
  • A registered domain name (for public-facing services)

Baseline Measurement

Regular maintenance is essential for keeping your sysbench installation running smoothly. Schedule periodic reviews of log files, disk usage, and security updates to prevent issues before they occur.


# Kernel tuning: /etc/sysctl.d/99-performance.conf
cat << 'EOF' | sudo tee /etc/sysctl.d/99-performance.conf
# Network performance
net.core.somaxconn = 65535
net.core.netdev_max_backlog = 65535
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_fin_timeout = 15

# Memory management
vm.swappiness = 10
vm.dirty_ratio = 15
vm.dirty_background_ratio = 5

# File descriptors
fs.file-max = 2097152
fs.nr_open = 2097152
EOF

sudo sysctl --system

Note that file paths may vary depending on your Linux distribution. The examples here are for Debian/Ubuntu; adjust paths accordingly for RHEL/CentOS-based systems.

Kernel and OS Tuning

The default configuration works well for development environments, but production servers require additional tuning. Pay particular attention to connection limits, timeout values, and logging settings.


# Benchmark before and after optimization
# CPU benchmark
sysbench cpu --cpu-max-prime=20000 run

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

# Disk I/O benchmark
sysbench fileio --file-total-size=4G --file-test-mode=rndrw prepare
sysbench fileio --file-total-size=4G --file-test-mode=rndrw run
sysbench fileio --file-total-size=4G cleanup

Make sure to restart the service after applying these changes. Some settings require a full restart rather than a reload to take effect.

  • Keep your system packages updated regularly
  • Review log files weekly for anomalies
  • Monitor disk space usage and set up alerts
  • Enable automatic security updates for critical patches

Application-Level Optimization

It's recommended to test this configuration in a staging environment before deploying to production. This helps identify potential compatibility issues and allows you to benchmark performance differences.


# Kernel tuning: /etc/sysctl.d/99-performance.conf
cat << 'EOF' | sudo tee /etc/sysctl.d/99-performance.conf
# Network performance
net.core.somaxconn = 65535
net.core.netdev_max_backlog = 65535
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_fin_timeout = 15

# Memory management
vm.swappiness = 10
vm.dirty_ratio = 15
vm.dirty_background_ratio = 5

# File descriptors
fs.file-max = 2097152
fs.nr_open = 2097152
EOF

sudo sysctl --system

The configuration above sets the recommended values for a VPS with 2-4GB of RAM. Adjust the memory-related settings proportionally if your server has different specifications.

  • Keep your system packages updated regularly
  • Review log files weekly for anomalies
  • Monitor disk space usage and set up alerts

Caching Strategy

Regular maintenance is essential for keeping your sysbench installation running smoothly. Schedule periodic reviews of log files, disk usage, and security updates to prevent issues before they occur.


# Benchmark before and after optimization
# CPU benchmark
sysbench cpu --cpu-max-prime=20000 run

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

# Disk I/O benchmark
sysbench fileio --file-total-size=4G --file-test-mode=rndrw prepare
sysbench fileio --file-total-size=4G --file-test-mode=rndrw run
sysbench fileio --file-total-size=4G cleanup

Make sure to restart the service after applying these changes. Some settings require a full restart rather than a reload to take effect.

Summary

You've successfully configured sysbench on your VPS. Remember to monitor performance, keep your software updated, and maintain regular backups. If you run into issues, consult the official documentation or open a support ticket for assistance.

Was this article helpful?