Sysbench

Sysbench
The package provides the sysbench application, which provides benchmarking capabilities towards Linux. It supports testing CPU, memory, File I/O, mutex performance and even MySQL benchmarking.

To install benchmark, there are two USE flags applicable.

Using sysbench
As mentioned, sysbench supports several benchmark workloads: fileio, cpu, memory, threads, mutex, oltp

Using the fileio workload
When using fileio, you will need to create a set of test files to work on. It is recommended that the size is larger than the available memory to ensure that file caching does not influence the workload too much.

As this is I/O benchmarking, you can tell sysbench which kind of workload you want to run: sequential reads, writes or random reads, writes, or a combination. In the above example, random read/write is used (rndrw). The duration of the test is given through the --max-time parameter (in seconds).

The output of a run is shown below:

The important part to look at is the information regarding the operations: Operations performed: 14788 Read, 9858 Write, 31488 Other = 56134 Total Read 231.06Mb Written 154.03Mb  Total transferred 385.09Mb  (1.2836Mb/sec)

These numbers can be compared with runs on different file systems, other systems, etc.

Using the cpu workload
When running with the cpu workload, sysbench will verify prime numbers by doing standard division of the number by all numbers between 2 and the square root of the number. If any number gives a remainder of 0, the next number is calculated. As you can imagine, this will put some stress on the CPU, but only on a very limited set of the CPUs features.

The benchmark can be configured with the number of simultaneous threads and the maximum number to verify if it is a prime.

The number to verify with other systems is given by the execution summary: total time:                         18.0683s total time taken by event execution: 36.1322

The event execution time is the pure calculation part. If you run the test with multiple threads, it is the sum of the time of all threads. The total time is the end-to-end time, and as such includes the overhead of shared memory access for the threads (although this is usually neglectible). Unlke the event execution time, the total time is the duration from start to finish (so no culmination of individual times of the threads).

Resources

 * How to benchmark your system with sysbench