Timely tips for speeding up your Raspberry Pi

RAM Tuning

In modern times, when even entry-level PCs have several gigabytes of main memory, Raspberry Pi's 256MB or 512MB seems anachronistic. The small amount of RAM in the Raspberry Pi puts the focus on implementing frugal programs. Although you can overclock RAM, this approach does not give you any significant performance improvements. It is more important to divide the memory between the operating system (normal use) and the graphics processing unit (GPU).

You can assign the RAM to the GPU in increments of 16MB using the gpu_mem configuration parameter. You can do this with raspi-config or directly in /boot/config.txt. For a headless server, you would obviously want to set the GPU value to the minimum of 16MB. The current firmware also supports dynamic memory splitting [3].

Well Connected?

The Raspberry Pi Model B has a Fast Ethernet port with a nominal transfer rate of 100Mbps, which restricts the throughput to about 10MBps. Because the corresponding chip resides on the USB bus, it shares its throughput with other connected devices, such as USB hard drives. Also, the fairly simple module causes a higher CPU load than its contemporaries on typical desktop boards.

You can test the network throughput with the test tool, iperf (which you need to install on the Raspberry Pi with administrative rights by typing apt-get install iperf) and on a second computer. Ideally, the two computers will be connected to a gigabit switch; also, the second computer network card must support gigabit Ethernet.

This setup ensures that only the Rasp Pi's performance limits the bandwidth. You can start iperf in server mode on the second computer first, by typing iperf -s, and then on the Raspberry using the following:

# iperf -c <IP_of_other_end>

That said, the synthetic iperf results do not take into account that the Ethernet connection and hard disk access use the same USB chip. It is more realistic to set up NFS or Samba and access a network drive that is provided by the Rasp Pi. Although the Raspberry Pi is not suitable as a backup medium for huge files, it is more than capable of handling multimedia streaming.

Because the driver can run into trouble under heavy network load, its author recommends the boot parameters smsc95xx.turbo_mode = N in the /boot/cmdline.txt file on computers with a slow CPU.

Although this approach reduces the throughput slightly, it does avoid errors. Otherwise, network tuning is not significantly different from any Linux on any other platform. General advice is not possible, because the settings depend on the application and also the other end of the connection.

Buy this article as PDF

Express-Checkout as PDF

Pages: 8

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content