SSDs & Swap on low-spec laptops

Help with issues regarding installation of Debian

SSDs & Swap on low-spec laptops

Postby secdroid » 2019-12-06 14:54

I am confused about the use of swap files and swap partitions with SSD drives. In addition to conflicting opinions with regard to the impact of swap on SSD longevity, there is little precision about what is "sufficient" RAM so that one can go swapless.

Usage: Debian 10 with XFCE, Firefox browser (< 8 tabs max), LibreOffice, Thunderbird, YouTube, light programming. No hibernate or suspend, just shutdown.

Systems --
  • Lenovo 14W Laptop - AMD A6-9220C (64-bit CPU), 4 GB RAM, 64 GB eMMC SSD (dual-boot 32 GB Win 10 Pro, 32 GB MX Linux), 128 GB micro SD, soon to be "daily driver"
  • HP Stream 11 Laptop - Celeron N2840 (64-bit CPU), 2 GB RAM, 32 GB eMMC SSD (MX Linux gets whole SSD), 64 GB microSD, light usage -- former "daily driver" - Currently running Debian 8.
I am leaning toward using a 4 GB swap file, not partition, on the removable microSDs. Rationale: maximize SSD lifetime on mainboard SSD, although swap performance will be reduced. Micro SD is cheap and easily replaceable.

The most (apparently) authoritative info I have found is this 2011 MSDN quote [https://superuser.com/questions/51724/should-i-keep-my-swap-file-on-an-ssd-drive]:

Should the pagefile be placed on SSDs?

Yes. Most pagefile operations are small random reads or larger sequential writes, both of which are types of operations that SSDs handle well.

In looking at telemetry data from thousands of traces and focusing on pagefile reads and writes, we find that

  • Pagefile.sys reads outnumber pagefile.sys writes by about 40 to 1,
  • Pagefile.sys read sizes are typically quite small, with 67% less than or equal to 4 KB, and 88% less than 16 KB.
  • Pagefile.sys writes are relatively large, with 62% greater than or equal to 128 KB and 45% being exactly 1 MB in size.
In fact, given typical pagefile reference patterns and the favorable performance characteristics SSDs have on those patterns, there are few files better than the pagefile to place on an SSD.

Would greatly appreciate guidance.
secdroid
 
Posts: 38
Joined: 2009-12-18 18:38

Re: SSDs & Swap on low-spec laptops

Postby CwF » 2019-12-06 20:34

For the MX I would recommend testing with zram-tools. Firefox will swap out sleeping tabs and it will give you some headroom. 128-256MB of ram for zramswap will free that much or more, and prevent usage of the swap file/partition, that should be on the primary ssd and about 1G without hibernation.
CwF
 
Posts: 812
Joined: 2018-06-20 15:16

Re: SSDs & Swap on low-spec laptops

Postby eor2004 » 2019-12-07 00:19

Hi, I have 2 Laptops with SSD on them, one with 2Gb of Ram and a Swap partition of 2Gb, the other with 3Gb of ram and a swap partition of 4Gb, both in use more than 2 years and have no issue with them, Smart says both SSD are OK, if you want to go with no swap, make sure you have more than 4Gb of Ram memory, other option could be to create a swap file instead of a swap partition, hope this helps!
OS: Debian 10 Buster 64-bit DE: MATE 1.20 CPU: AMD Phenom II X4 925 @ 2.8GHZ RAM: 8GB CORSAIR XMS2 PC2-6400U DDR2 (CM2X2048-6400C5C) GPU: ATI Radeon HD 3200 Mobo: Gigabyte GA-MA78GPM-DS2H HDD: Hitachi 2TB (HUA723020ALA641) 7200RPM
User avatar
eor2004
 
Posts: 219
Joined: 2013-10-01 22:49
Location: Puerto Rico

Re: SSDs & Swap on low-spec laptops

Postby Head_on_a_Stick » 2019-12-07 09:38

Code: Select all
empty@E485:~ $ cat /sys/block/nvme0n1/queue/rotational                                   
0
empty@E485:~ lsblk | grep -i swap                                                   
├─nvme0n1p2 259:2    0     4G  0 part [SWAP]
empty@E485:~ $

Do I look bothered?

Read this: https://techreport.com/review/27909/the ... -all-dead/

Modern production SSDs will likely outlast their spinning rust cousins.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12785
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: SSDs & Swap on low-spec laptops

Postby p.H » 2019-12-07 11:50

I wonder, do eMMC devices qualify as modern SSDs ? Do they have sophisticated flash controllers like modern SATA or NVMe SSDs ?
p.H
 
Posts: 1521
Joined: 2017-09-17 07:12

Re: SSDs & Swap on low-spec laptops

Postby Head_on_a_Stick » 2019-12-07 12:17

^ Good point, I missed the eMMC bit.

A bit old but useful: https://www.elinux.org/images/2/2c/Wear ... Memory.pdf

@OP: try
Code: Select all
# apt install mmc-utils
# mmc extcsd read /dev/mmcblk1 | grep 'LIFE\|EOL'

Adjust the block device as required.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12785
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: SSDs & Swap on low-spec laptops

Postby secdroid » 2019-12-07 12:37

Thanks to all for the responses.

I was not aware of ZRam. It looks like I have a perfect use case for it. I started with https://wiki.debian.org/ZRam which links https://en.wikipedia.org/wiki/Zram which, in turn links lots of good info. Wikipedia also linked to https://en.wikipedia.org/wiki/Solid-state_drive#SWAP which said --
Swap partitions

  • According to Microsoft's former Windows division president Steven Sinofsky, "there are few files better than the pagefile to place on an SSD".[232] According to collected telemetry data, Microsoft had found the pagefile.sys to be an ideal match for SSD storage.[232]
  • Linux swap partitions are by default performing TRIM operations when the underlying block device supports TRIM, with the possibility to turn them off, or to select between one-time or continuous TRIM operations.[197][198][199]

I will definitely pursue adopting ZRam for both laptops.

***

eMMC vs. SSD storage: What's the difference? https://www.windowscentral.com/emmc-vs-ssd

***

FWIW, this HP Stream 11 got a 4 GB swap partition when I installed Debian 8/LXDE back in December 2015. [It came with Windows 8.1 --- yuck]. The eMMC SSD is soldered to the mobo, as is the battery. So far, SSD and battery are still going strong.

After reading all the conflicting stuff about SSDs and swap, I want to try to optimize my MX 19 [Debian 10 XFCE] installs.
secdroid
 
Posts: 38
Joined: 2009-12-18 18:38

Re: SSDs & Swap on low-spec laptops

Postby secdroid » 2019-12-08 12:18

Head_on_a_Stick wrote:@OP: try
Code: Select all
# apt install mmc-utils
# mmc extcsd read /dev/mmcblk1 | grep 'LIFE\|EOL'

Adjust the block device as required.

Test results from the HP Stream 11 with 32 GB eMMC running Debian 8 for 4 years. Tested with Buster on MX 19 live USB because there was no mmc-utils in Jesse.

Code: Select all
root@mx1:/home/demo# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0          7:0    0  1.4G  1 loop /live/linux
sda            8:0    1 14.6G  0 disk
├─sda1         8:1    1  1.4G  0 part /live/boot-dev
└─sda2         8:2    1  3.1M  0 part
sdb            8:16   1 59.5G  0 disk
└─sdb1         8:17   1 59.5G  0 part
mmcblk0      179:0    0 29.1G  0 disk
├─mmcblk0p1  179:1    0  7.4G  0 part
├─mmcblk0p2  179:2    0    1K  0 part
├─mmcblk0p5  179:5    0  962M  0 part [SWAP]
└─mmcblk0p6  179:6    0 20.8G  0 part
mmcblk0boot0 179:256  0    4M  1 disk
mmcblk0boot1 179:512  0    4M  1 disk

root@mx1:/home/demo#  mmc extcsd read /dev/mmcblk0 | grep 'LIFE\|EOL'
eMMC Life Time Estimation A [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]: 0x01
eMMC Life Time Estimation B [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]: 0x02
eMMC Pre EOL information [EXT_CSD_PRE_EOL_INFO]: 0x01

If I understand the results correctly, 0x01 means 0-10% of the reserved blocks have been used and 0x02 means 10-20% of the reserved blocks have been used. I've not been able to find much info on interpretation of these results. Some header file?
secdroid
 
Posts: 38
Joined: 2009-12-18 18:38

Re: SSDs & Swap on low-spec laptops

Postby Head_on_a_Stick » 2019-12-08 14:30

secdroid wrote:If I understand the results correctly, 0x01 means 0-10% of the reserved blocks have been used and 0x02 means 10-20% of the reserved blocks have been used.

Yes, I think so. See page 15 of the PDF I linked earlier for a breakdown. The EOL bit has three options and yours is in the "safe" zone.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12785
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: SSDs & Swap on low-spec laptops

Postby secdroid » 2019-12-09 14:42

Head_on_a_Stick wrote:A bit old but useful: https://www.elinux.org/images/2/2c/Wear ... Memory.pdf

Some background info for the cited slide deck -- https://www.cnx-software.com/2019/08/16/wear-estimation-emmc-flash-memory/

Health Status as Defined in the eMMC 5.0 Standard Onwards

Since e.MMC 5.0, device health status became part of the standard. It provides life time estimation for SLC and MLC areas as well as pre EOL status:

  • Device life time estimation type A: life time estimation for SLC eraseblocks, provided in steps of 10%, e.g.:
    - 0x02 means 10%-20% device life time used.
  • Device life time estimation type B: life time estimation for MLC eraseblocks, provided in steps of 10%, e.g.:
    - 0x02 means 10%-20% device life time used.
  • Pre EOL information: overall status for reserved blocks. Possible values are:
    - 0x00 - Not defined.
    - 0x01 - Normal: consumed less than 80% of the reserved blocks.
    - 0x02 - Warning: consumed 80% of the reserved blocks.
    - 0x03 - Urgent: consumed 90% of the reserved blocks.
Source - https://developer.toradex.com/knowledge-base/emmc-linux

Thanks for all the help!
secdroid
 
Posts: 38
Joined: 2009-12-18 18:38


Return to Installation

Who is online

Users browsing this forum: No registered users and 13 guests

fashionable