Benchmarking RAM speed on a Linux system reveals how quickly memory can move data for applications and the kernel, especially under intensive workloads. Accurate measurements of read and write throughput highlight whether memory keeps pace with CPU and storage performance, guiding tuning efforts and hardware decisions. Consistent measurements over time also help detect regressions caused by configuration changes or kernel updates.
On Linux, tools such as sysbench simulate controlled memory workloads and report metrics such as operations per second and MiB per second. The memory test mode allocates a configurable buffer, executes sequential or random access with a chosen block size, and records how fast data is transferred. Adjusting parameters such as total test size, thread count, and access mode provides a view of behavior both for single-threaded operations and for concurrent workloads.
Running synthetic memory benchmarks increases RAM traffic and CPU usage, so tests are best performed on an otherwise idle system to avoid skewed results. Installing sysbench requires sudo privileges and the appropriate package manager for the distribution, and very long tests can temporarily impact other processes. Choosing realistic parameters and capturing results in files allows repeatable measurements without disrupting critical services.
Steps to benchmark RAM speed in Linux:
- Open a terminal on the Linux system with access to a sudo-capable account.
$ whoami user
- Install sysbench using the package manager for Ubuntu or other Debian-based distributions.
$ sudo apt update && sudo apt install --assume-yes sysbench
On RHEL and CentOS, install using sudo dnf install --assume-yes sysbench or sudo yum install --assume-yes sysbench.
- Run a basic memory benchmark using default parameters to obtain an initial throughput value.
$ sysbench memory run sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3) Running the test with the following options: Number of threads: 1 Initializing random number generator from current time Running memory speed test Operations performed: 1048576 (209715.20 ops/sec) 1024.00 MiB transferred (204.80 MiB/sec) General statistics: total time: 5.0002s total number of events: 1048576 ##### snipped #####The reported MiB/sec value indicates effective memory bandwidth for the selected test parameters.
- Increase block size and total memory size to stress sequential throughput more heavily.
$ sysbench memory --memory-block-size=1K --memory-total-size=5G run
Very large values for memory-total-size on systems under load can cause long benchmark durations and impact other processes.
- Run a write-only benchmark to focus on pure write performance characteristics.
$ sysbench memory --memory-oper=write --memory-total-size=2G run
The memory-oper option accepts read, write, or none to control the type of memory access performed.
- Increase the number of threads to observe how memory throughput scales with parallel workloads.
$ sysbench memory --threads=4 --memory-total-size=4G run
Raising the thread count can reveal contention in memory channels or limits in the memory controller under concurrent access.
- Save benchmark output to a text file for later comparison across configuration changes or hardware upgrades.
$ sysbench memory --memory-total-size=2G run > memory_benchmark.txt
Keeping timestamped result files enables easy trend analysis over kernel, firmware, or RAM timing changes.
- Verify that the saved results contain the expected throughput metrics for future reference.
$ grep -E 'MiB/sec|transferred' memory_benchmark.txt 1024.00 MiB transferred (204.80 MiB/sec)
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
Comment anonymously. Login not required.
