Welcome! Log In Create A New Profile

Advanced

Swap File Management

Posted by JoeyPogoPlugE02 
Swap File Management
May 04, 2015 03:31PM
Linux aficionados of expertise, as you well know there are conflicting schools of thought regarding swap files.

And instead of my mentioning the ways that don't work for my situation, maybe we can start fresh; Pogoplug Pro or anything you may need to be clever about RAM management.

What's the latest?

=========
-= Cloud 9 =-
Re: Swap File Management
July 09, 2015 01:34PM
I think the generally accepted wisdom is try to avoid using swap on flash based devices, as the repeated writes can wear out the NAND cells prematurely ...

For hard disc, knock yourself out, anywhere between 1/2 and 2 times the memory depending on what your machine is doing ... seperate swap partition are generally recommended ... and if you have two or more discs, then create swap parition on each disc, and linux will automagically RAID the swap partitions ...

In a nutshell ...

Cheers

Don Charisma ... because anything is possible with Charisma

My blog - http://DonCharisma.org
Our commercial site - http://DonCharisma.com
Re: Swap File Management
July 12, 2015 12:43AM
Cheers Don, yeah I wish there were a happy medium between a flash drive and a 1-cord portable hard drive.

In the meantime when using USB drive my strategy is to set swap to 4GB-ish, figuring that might spread out the wear & tear. Linux itself doesn't take up too much space and zswap and low swappiness help to minimize the need to swap.

Hey, SSDs are NAND, right?

=========
-= Cloud 9 =-
Re: Swap File Management
July 12, 2015 08:15PM
JoeyPogoPlugE02 Wrote:
-------------------------------------------------------
> Cheers Don, yeah I wish there were a happy medium
> between a flash drive and a 1-cord portable hard
> drive.
>
> In the meantime when using USB drive my strategy
> is to set swap to 4GB-ish, figuring that might
> spread out the wear & tear. Linux itself doesn't
> take up too much space and zswap and low
> swappiness help to minimize the need to swap.
>
> Hey, SSDs are NAND, right?


Joey,

It really does not make a difference in wear n tear when you increase swap space. 1GB is plentiful, chance is that < 100MB will be used. Larger swap only a precaution. And it wont spread out. Zswap is what should help to reduce writes.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Swap File Management
July 14, 2015 04:49PM
Possible under Wheezy to use mtdblock3 on PogoPlug E02 to hold a swapfile, or swap partition for that matter?

If possible what would be the pros and cons if implementing a small, 64mb, swapfile?

debian:~# uname -a
Linux debian 3.2.0-4-kirkwood #1 Debian 3.2.68-1+deb7u2 armv5tel GNU/Linux

debian:~# cat /proc/cpuinfo
Processor : Feroceon 88FR131 rev 1 (v5l)
BogoMIPS : 1191.11
Features : swp half thumb fastmult edsp
CPU implementer : 0x56
CPU architecture: 5TE
CPU variant : 0x2
CPU part : 0x131
CPU revision : 1

Hardware : Marvell SheevaPlug Reference Board
Revision : 0000
Serial : 0000000000000000

debian:~# ps aux | grep mtd
root 24 0.0 0.0 0 0 ? S Jul12 0:00 [mtdblock0]
root 25 0.0 0.0 0 0 ? S Jul12 0:00 [mtdblock1]
root 26 0.0 0.0 0 0 ? S Jul12 0:00 [mtdblock2]
root 27 0.0 0.0 0 0 ? S Jul12 0:00 [mtdblock3]

debian:~# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=30903,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=25524k,mode=755)
/dev/sda1 on / type ext2 (rw,noatime,errors=remount-ro)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=51040k)
none on /dev/shm type tmpfs (rw,nosuid,nodev,relatime)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)

debian:~# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 7.4G 1.1G 6.0G 15% /
udev 10M 0 10M 0% /dev
tmpfs 25M 120K 25M 1% /run
/dev/sda1 7.4G 1.1G 6.0G 15% /
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 125M 0 125M 0% /dev/shm
none 125M 0 125M 0% /dev/shm
Re: Swap File Management
July 14, 2015 06:30PM
thawkins Wrote:
-------------------------------------------------------
> Possible under Wheezy to use mtdblock3 on PogoPlug
> E02 to hold a swapfile, or swap partition for that
> matter?
>

It's possible, but not recommended to use NAND mtd for swap.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: