brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: vcgencmd measure_clock arm shows the real CPU speed of a Raspberry Pi

CLI
~/tips/tip-vcgencmd-measure-clock-arm

vcgencmd measure_clock arm

Reads the actual Arm clock in hertz, which can differ from the speed the kernel asked for.

When a Raspberry Pi feels slow, I want to know the clock speed it really runs at. The usual file in /sys only tells half of the story.

vcgencmd measure_clock arm

This returns the current frequency of the Arm cores, in hertz. The same command takes other clocks as an argument, among them core (the GPU core), emmc (the SD card interface), v3d, isp and hdmi.

The other way is a file the kernel exposes:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

That number is in kilohertz, so divide by 1000 for megahertz. The docs point out the catch. It is the frequency the kernel requested, and throttling, for example at high temperatures, can mean the CPU actually runs slower than reported. The vcgencmd command gives an instantaneous measurement of the actual Arm clock.

So when I suspect throttling, I’d run both and compare them while the board is busy. If the two differ, look at the temperature with vcgencmd measure_temp, which reports the SoC temperature from its internal sensor.

One caveat: the docs say the result is displayed in hertz, not megahertz, so divide by a million to compare it with the other number. It is also a snapshot of one moment, not an average.

Further reading: vcgencmd documentation, Overclocking and frequency

More CLI tips printf 'GET /\r\n' | hexdump -C hexdump -C -s 512 -n 64 disk.img wget --limit-rate=2m https://example.com/big-file.iso wget --spider https://example.com/file.zip rg 'apiKey' -g '!*.min.js' -g '!package-lock.json' All CLI tips (46) All topics

Link