Performance Tuning

We all want our systems running with the best performance possible. Bet you didn't know you could tweak your Pi to do just that ! So I'm going to give you some pointers, albeit are purely just optional... but can and will be beneficial for the longevity of your Pi, and it will be thanking you for it.

The TMPFS system

What is it, and what does it do? Simply put, instead of storing certain directories on the SDCARD it moves it into RAM instead, hence being "temporary file system". The benefits, check out these points:

Performance:

  • reads, writes, and seeks are insanely fast in a tmpfs; as fast as accessing RAM

Security:

  • data leaks to disk are prevented (especially when swap is disabled), and since /tmp is its own mount point, we should add the nosuid and nodev options (and motivated sysadmins could add noexec, if they desire)

Energy efficiency:

  • disk wake-ups are avoided

Reliability:

  • fewer NAND writes to SSD disks

Let's get to it and get your Pi juiced up!

Head over and edit the ( sudo nano /etc/fstab ) file, and add the following lines:

tmpfs /tmp tmpfs defaults,noatime,nosuid,noexec,size=100m 0 0

tmpfs /var/tmp tmpfs defaults,noatime,nosuid,size=30m 0 0

tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=100m 0 0

tmpfs /var/run tmpfs defaults,noatime,nosuid,mode=0755,size=2m 0 0

tmpfs /var/spool/mqueue tmpfs defaults,noatime,nosuid,mode=0700,gid=12,size=30m 0 0

Save the file with ( Ctrl+x )

Now to make all these settings go into affect. Type the following command sudo mount -av

That's it, easy right. Now enjoy a faster, more secure and robust Pi :)

results matching ""

    No results matching ""