Rich Freeman on 16 Apr 2015 07:38:40 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] swappiness and ssd


On Thu, Apr 16, 2015 at 10:24 AM, Anthony Martin
<anthony.j.martin142@gmail.com> wrote:
> We had a discussion about this on the G+ page. There really isn't a need for
> a large amount of swap in most cases nowadays since we have so much physical
> ram. Also as both Rich and Rich said the small performance increase you
> would get isn't really worth the damage to you SSD.
>

You might want to look into zram.  I suspect it can be used for swap,
but I use it as a compressed tmpfs.  Gentoo's /usr/portage directory
is rsyned daily with many small files that frequently change.  I was
concerned about ssd wear, but it is otherwise an ideal directory to
have on ssd.  I first tried putting it on tmpfs but it used gobs of
RAM.  Then I moved it to zram and it uses far less actual memory,
since the files are all small text files that compress well.  I mount
it with:

[Unit]
Description=Mount /usr/portage as zram.
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target

[Service]
Type=oneshot
RemainAfterExit=true

# Adapt the maximal size (in this example 2 GB) and other options to your needs.
# Make sure to avoid collision of devices (-d...) with
# zram_swap.service and zram_var_tmp.service and
# that num_devices in modprobe.d/zram.conf contains the maximal used number + 1

ExecStart=/usr/sbin/zram-init -d0 -text4 -ostrictatime -m1777 3000 /usr/portage
ExecStop=/usr/sbin/zram-init -d0 0 /usr/portage

[Install]
WantedBy=local-fs-pre.target

--
Rich
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug