Before we start to overclock our Raspberry Pi, we have to prepare and check some conditions.
To learn the current frequency the CPU is setup and running, we have to read out the proc files cpuinfo_min_freq, cpuinfo_max_freq and cpuinfo_cur_freq from the /sys/devices/system/cpu/cpu0/cpufreq/ directory, where:
To know the current temperature of CPU, we can run the vcgencmd measure_temp command. To watch the temperature every second, we can run it in a “while” loop like this:
$ while true ; do vcgencmd measure_temp ; sleep 1 ; done
This loop is running until we terminate it with CTL+C.
The default CPU configuration for the Raspberry Pi board, which goes in idle mode with no task is the following:
If processes are running, the frequency goes up to:
To prevent the idle mode from damaging, we have to set these lines in your /boot/config.txt:
After that, reboot your Raspberry Pi and check the current running frequency again. It should now be set to 1200000 KHz.
For the first performance test, we run the following command.
$ sysbench --test=memory --cpu-max-prime=2000 --num-threads=4 run
This gives us the following results as an output:
Keep that in mind for the test at the end with the overclocked Raspberry Pi 3.