Speeding Up My Raspberry Pi 3


When the Raspberry Pi came out in February 2012, I didn't buy one. In 2014 the RPi 1 Model B came out; I bought one of those. The Model B had 512 MBytes of memory, as opposed to 256 MBytes on the original 2012 model. The Model B still had a 700 MHz single core Arm processor, so I overclocked it to 1 GHz. My RPi 1 Model B was still pretty slow, but I found ways around that, like writing Java programs with GCJ instead of the Sun jdk. Since then I discovered Risc OS, which will run admirably fast on my RPi 1 Model B. So, after all these years, I've kept my RPi 1 Model B.

The Raspberry Pi 2 came out in 2015; I never bought one. The RPi 2 was a significant improvement over the RPi 1; 4 core versus 1, 900 MHz versus 700 MHz, 1 GByte of RAM versus 512 MBytes. I already overclocked my RPi 1 to 1 GHz. One GByte of memory is twice as much as 512 MBytes, but it's not so much more memory that I could do a whole lot more with it. Four core versus one is significant, but we're still talking about low powered cores. I just didn't feel like the RPi 2 offered enough to make me want to purchase one.

In 2016 the Raspberry Pi 3 Model B came out; I bought one - I created this blog on it, today (05/19/2019). The processor speed was 1.2 GHz, still 1 GByte of RAM, still used a 4 port USB hub (2.0). That doesn't sound like a tremendous advance over the RPi 2, but it was still a lot compared to my RPi 1. Raspbian (the OS, Debian 9.6 for armhf processors) had also changed with a nice new desktop environment called Pixel.

Pixel is a re-write of LXDE; the original DE (Desktop Environment) for the Raspberry Pi. LXDE is very lightweight (which is what you'd expect for a device like the RPi), but to speed up my RPi via a different DE, I needed something even leaner; IceWM. IceWM is an extremely lightweight windows manager for Linux, and even has a full DE that is very lightweight. This is what's in my .xsession file:

#/bin/bash
.$HOME/.bash_profile
exec icewm-session
xterm

#This is what's in $HOME/.icewm/preferences DesktopBackgroundImage="/home/pi/Pictures/1967-ferrari-p4-replica.jpg"
DesktopBackgroundScaled=1








The next thing you see me doing in the video (at the top of this webpage) is enter the command lsblk and getting the following results:


NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 59.6G 0 disk
├─sda1 8:1 1 57.6G 0 part /run/schroot/mount/My-chroot-directory-46dc960
└─sda2 8:2 1 2G 0 part /media/pi/MSDOS FS2
sdb 8:16 0 1.8T 0 disk
└─sdb1 8:17 0 1.8T 0 part /media/pi/Dave's Disk
sdc 8:32 1 1.4M 0 disk /media/pi/MS-DOS_62
sr0 11:0 1 1024M 0 rom
mmcblk0 179:0 0 59.6G 0 disk
├─mmcblk0p1
│ 179:1 0 43.9M 0 part /boot
└─mmcblk0p2
179:2 0 59.6G 0 part /
zram0 254:0 0 234.8M 0 disk [SWAP]
zram1 254:1 0 234.8M 0 disk [SWAP]
zram2 254:2 0 234.8M 0 disk [SWAP]
zram3 254:3 0 234.8M 0 disk [SWAP]

zram0 through zram3 are compressed ram disks used for swapping. If a computer that supports virtual memory (that's about every computer today) finds itself running out of memory, it copies a section of memory that is currently inactive to disk, freeing up that memory for use by an active program; this is called swapping. ZRam creates compressed ram disks that are used for the swapping process; one for each core. Swapping to a ram disk is much faster then swapping to a physical disk. The fact that the disks are compressed, actually saves on memory.

Finally, one of the last things you see in my video is me entering the lscpu command, which displays my top cpu speed of 1300 MHz. That's only 100 MHz more then my RPi 3 shipped with; 1.2 GHz. However, my RPi3 runs reliably and cool at that speed. With a faster windows manager (IceWM) and faster swapping, the 100 MHz boost is enough to make me feel like I accomplished something; i.e., I've sped up my RPi3. At 1300 MHz my RPi3 never approaches 70oC (the temperature that the RPi 3 starts throttling down). I never have to worry about instability or crashes while I'm running at 1300 MHz either. According to https://howtoraspberrypi.com/how-to-overclock-raspberry-pi/ the RPi 3 is overclockable to 1.5 GHz. I tried overclocking to 1.5 GHz (the instructions are provided in that link I just supplied) and my RPi wouldn't even boot. I tried 1.4 GHz and my RPi ran at that speed for a few hours before crashing. Next I tried 1350 MHz and everything seemed fine, but my RPi would overheat under load (e.g., playing a youtube video). I ordered what I thought was better themal tape then what was supplied with the iUniker fan I had installed before overclocking; it didn't cool any better (or as well). Finally at 1.3 GHz, everything seems to be running just fine.

Yes, I installed a fan on my RPi 3. It's an iUniker double fan, that also came with a copper heatsink for the ram chip. You can see me showing the fan on amazon.com (where I bought it) in the video at the top of this webpage. The problem with overclocking a RPi 3 is the processor overheats. The iUniker setup should do the trick on cooling off my RPi 3, but it didn't make it all the way 1.5 GHz (and it never even got a chance to overheat, so I can't blame the iUniker fan.). All in all, I'm still happy how things have turned out. My RPi 3 seems to be running along trouble free, and it does feel a little faster then the day I bought it.

Return To My Blog Page       Return To My Programming Page