View previous topic :: View next topic |
Author |
Message |
ericbish n00b
Joined: 27 Apr 2018 Posts: 30
|
Posted: Fri Apr 27, 2018 6:53 pm Post subject: My Pi3 Epiphany - reducing swap related IO |
|
|
This might help somebody else, so I though I'd throw it out here.
I had some periodic issues on my Gentoo Pi (great job btw!), mostly related to genup and a few other things. Anytime anything mem intensive was running, system would get super super slow. So it appeared to be an issue of being IO bound, which makes sense with the swap on the same sdcard as the system. My solution was to add a 32G EVO Fit USB Micro SD card, and dedicate it to swap. Now, that much isn't needed, but my first time running genup with this, I swapped up to 22G!!!! The difference in the Pi's performance was simply amazing!!!!
Here's the steps:
Install the SDcard in an available USB port, use dmesg/fdisk -l, etc to verify it's device name. In my case it was /dev/sda. Then do the following, replacing x with your device name:
fdisk /dev/sdx, delete all partitions, add a new primary, if you want to use it all, just take the defaults, and set the type to "82", linux swap.
swapon /dev/sdx then do a swapon -s and you should see to 2 swaps, the default, and your new one.
swapoff /var/cache/swap/swap1 to turn off the default swap (this is optional, I prefer to get my swap off the system sdcard completely, you could alternatively massage swap priorities)
Now, check /var/log/messages, dmesg, etc and make sure you're not getting any IO errors.
Edit your /etc/fstab and add this line:
/dev/sdx1 none swap sw 0 0
Comment out the default swap line (again, optional)
run mount -a, address any errors (there shouldn't be any).
sanity reboot now is recommended, not required.
Enjoy your new, faster Pi! |
|
Back to top |
|
|
Sakaki Guru
Joined: 21 May 2014 Posts: 409
|
Posted: Sat Apr 28, 2018 10:50 am Post subject: |
|
|
ericbish,
thanks, I agree it's definitely better to have swap and sysroot on separate buses on the RPi3 where possible. The image only ships with its (small) swap file on the rootfs for convenience.
I'll add a note to that effect to the project's readme. _________________ Regards,
sakaki |
|
Back to top |
|
|
Sakaki Guru
Joined: 21 May 2014 Posts: 409
|
Posted: Mon Apr 30, 2018 6:39 pm Post subject: |
|
|
I've just added a short note about this topic to the project's wiki, here, and linked it into the readme (commit). _________________ Regards,
sakaki |
|
Back to top |
|
|
ericbish n00b
Joined: 27 Apr 2018 Posts: 30
|
Posted: Tue May 01, 2018 2:42 pm Post subject: |
|
|
Nice write up! Much better than my quick little down and dirty! |
|
Back to top |
|
|
ab1jx n00b
Joined: 05 May 2018 Posts: 1 Location: Heath, MA USA
|
Posted: Sat May 05, 2018 2:19 pm Post subject: |
|
|
Sakaki wrote: | ericbish,
thanks, I agree it's definitely better to have swap and sysroot on separate buses on the RPi3 where possible. The image only ships with its (small) swap file on the rootfs for convenience.
I'll add a note to that effect to the project's readme. |
The standard swap size in Raspbian is 2 GB, I think that's 4 times as much from memory. A Facebook page in Firefox led to a hard crash. Very smooth experience until then. Just ordered a couple spare readers. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|