How to measure the CPU performance of a VPS?

A few days ago I told you how to know the speed of a HDD using the command ddWell, this time I will show you a tool that helps us benchmark many things, but today we will only use it to CPU performance.

cpu

Installing sysbench

This tool (sysbench) does not serve as I said before, to benchmark various things (I / O, CPU, MySQL, etc), this time we will only use it for the CPU, first obviously ... we must install it:

On systems like Debian, Ubuntu or similar:

sudo aptitude install sysbench

In ArchLinux and derivatives:

yaourt -S sysbench

Using sysbench to measure CPU performance

Now we only have to run it with admin privileges and with the appropriate parameters:

sysbench --test=cpu --cpu-max-prime=20000 run

what does this mean?

  1. We will do a CPU test
  2. The number must be such that the test lasts at least 10 seconds, 20000 is a value that should serve them.

Here are several outputs from my PC and some servers that I manage:

How to check CPU performance

The really important thing is the execution time, that is, how fast the CPU completed the test.

That is, in the 1st screenshot it is seen that the CPU completed the test in 40.5 seconds, the second shows that it completed it in 46.5 seconds, while the 3rd and last screenshot indicates that the test was completed in 26.9 seconds.

This means that the 3rd CPU is the fastest, because it completed the test in less time than the others, Simple or not?

By the way, if you are thinking that a server/computer with 8 cores and another with only 4, the one with 8 cores will always complete the test faster because it has a greater number… you are wrong, the test runs on a single core, that is, the number does not matter here 

Well that's all, I hope it has been useful, I'm still running tests on the GNUTransfer VPS 