Make your Raspberry Pi faster


I have heard many people (including yours truly) say that the Raspberry Pi should be faster than it is.  In it's Mk 3 form, with all cores firing it ought to be a lot of performance for the price, but many of us are strangling the performance, often without even realising what we are doing.

Here's some simple tips to getting the best performance:

Power it properly

Just because the Pi has a micro-USB connector for power doesn't mean you should use some ancient phone charger to power it.  This board needs a stable five volts at around two amps to operate properly, and even more under heavy compute loads.  Most small plug pack supplies will struggle to sustain one amp.  Try to draw a higher current and the output voltage will almost certainly droop (drop slightly).

When this happens, you might see a "lightning bolt" on the monitor (if you have one connected") or notice "undervoltage" messages on the console.  Then the Pi detects an undervoltage condition, it scales back the CPU, robbing your performance.

The solution is to invest in a decent quality adapter such as the M8820 from Altronics.  For permanent installations I usually fit a small closed-frame switchmode supply.  You want something rated 30W or greater, and they aren't really that expensive.

I also try to avoid powering other devices from the USB ports on the Pi.  If you need a number of USB devices, consider a powered hub.

SD Performance

The only storage the Raspberry Pi has by default is the SD card it booted from.  These are not the fastest media out there to start with, but cheap ones can be many times slower than high transfer rate cards from the major vendors.

To be fair, we shouldn't be relying on high I/O rates with a Raspberry Pi anyway, but a relatively small price premium gets a higher speed card, and that can mean a much shorter boot time.

Keep Your Cool

Here's an experiment:  Run a very compute-intensive job on a Raspberry Pi and put your finger on the big chip in the middle.  You will notice it can get uncomfortably hot.  The Raspberry Pi kernel implements a thermal governor, which will throttle back the CPU if a predetermined temperature is exceeded.  A small heatsink on the CPU can delay this problem, or eliminate it altogether depend on the workload and external environment.

The only problem with adding a heatsink is that it may foul any add-on HAT boards you install, so be careful.

You could add an external fan, or even liquid cooling if you want, but the latter at least is probably a little excessive.

Memory Sharing

If you are running your Raspberry Pi and not using graphics or gpu-based mathematics (it is possible, but that's another article), consider reducing the amount of memory shared with the GPU.  This is configured with raspi-config

I hope these hints help you to get the most of your Raspberry Pi board.



Comments

Popular posts from this blog

The QYT KT-7900D

OpenVMS on KVM

Recording weather with Arduino, Elasticsearch and Kibana