User avatar
bonzadog
Posts: 272
Joined: Wed Apr 25, 2012 9:40 am
Location: Rietberg/Germany

/etc/dphys-swapfile CONF_SWAPSIZE Value

Sat Mar 14, 2020 5:32 pm

Hello,

Apart from using Memory what effect would a permanent value of CONF_SWAPSIZE=2048 be.
I assume this is the size of the virtual storage?

User avatar
jahboater
Posts: 7033
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: /etc/dphys-swapfile CONF_SWAPSIZE Value

Sat Mar 14, 2020 5:48 pm

bonzadog wrote:
Sat Mar 14, 2020 5:32 pm
Apart from using Memory what effect would a permanent value of CONF_SWAPSIZE=2048 be.
I assume this is the size of the virtual storage?
No, its the size of the swap file. The virtual storage is the sum of the swap plus the size of the main (RAM) memory.
bonzadog wrote:
Sat Mar 14, 2020 5:32 pm
Apart from using Memory
If anything it may even reduce memory usage because infrequently accessed pages may be swapped out.

I would not bother personally, but it should be harmless.

If you mess with settings like vm.swappiness, you could reduce performance and/or wear out your SD card.

When a Pi is so overloaded that it is reliant on swapping, it will slow down to a crawl!

Get a 4GB Pi4 which has plenty of fast memory.

User avatar
DougieLawson
Posts: 41299
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: /etc/dphys-swapfile CONF_SWAPSIZE Value

Sat Mar 14, 2020 5:55 pm

It's filesystem space.

Don't change it unless your rootfs is on USB stick, hard drive or SSD.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

User avatar
bonzadog
Posts: 272
Joined: Wed Apr 25, 2012 9:40 am
Location: Rietberg/Germany

Re: /etc/dphys-swapfile CONF_SWAPSIZE Value

Sat Mar 14, 2020 7:40 pm

DougieLawson wrote:
Sat Mar 14, 2020 5:55 pm
It's filesystem space.

Don't change it unless your rootfs is on USB stick, hard drive or SSD.
OK, but booting to an USB HDD at the moment has not yet been released. I have read of other alternatives, but I will
wait for the official RPI.org release.

User avatar
bonzadog
Posts: 272
Joined: Wed Apr 25, 2012 9:40 am
Location: Rietberg/Germany

Re: /etc/dphys-swapfile CONF_SWAPSIZE Value

Sat Mar 14, 2020 7:49 pm

jahboater wrote:
Sat Mar 14, 2020 5:48 pm
bonzadog wrote:
Sat Mar 14, 2020 5:32 pm
Apart from using Memory what effect would a permanent value of CONF_SWAPSIZE=2048 be.
I assume this is the size of the virtual storage?
No, its the size of the swap file. The virtual storage is the sum of the swap plus the size of the main (RAM) memory.

Where is the defined..?......

bonzadog wrote:
Sat Mar 14, 2020 5:32 pm
Apart from using Memory
If anything it may even reduce memory usage because infrequently accessed pages may be swapped out.

I would not bother personally, but it should be harmless.

If you mess with settings like vm.swappiness, you could reduce performance and/or wear out your SD card.

I will use a USB HDD and boot from that when the raspberrypi.org finally the RPI4 4 GB "boot from usb HDD"
is finally released.



When a Pi is so overloaded that it is reliant on swapping, it will slow down to a crawl!

The problem is I have very large Python lists and directories which are memory bound - hence this discussion.
I am looking for a way to uses SQLITE3 instead.



Get a 4GB Pi4 which has plenty of fast memory.

User avatar
DougieLawson
Posts: 41299
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: /etc/dphys-swapfile CONF_SWAPSIZE Value

Sat Mar 14, 2020 8:42 pm

bonzadog wrote:
Sat Mar 14, 2020 7:40 pm
DougieLawson wrote:
Sat Mar 14, 2020 5:55 pm
It's filesystem space.

Don't change it unless your rootfs is on USB stick, hard drive or SSD.
OK, but booting to an USB HDD at the moment has not yet been released. I have read of other alternatives, but I will
wait for the official RPI.org release.
My RPiB+ doesn't boot with from USB but the rootfs is on a USB harddisk and has been since 2014. USB boot != USB rootfs you can boot from a read-only SDCard and have rootfs on any sensible connected device.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

LTolledo
Posts: 5319
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: /etc/dphys-swapfile CONF_SWAPSIZE Value

Sat Mar 14, 2020 10:30 pm

For "normal" desktop use, on a RPi4B-2G and 4G, enabling the swap may not be needed, unless you prefer running Chromium with at least 20 active tabs, and 7 or more other apps running as well.

also as others have pointed in the past, enabling swap on a microSD card only system will lessen the usable life of the microSD card itself,
hence the recommendation to use it only if using USB attached drives (preferably HDDs as against SSDs) where the rootfs in located.

on this SSD boot RPi3B+ swap is enabled, with a setting of

Code: Select all

CONF_SWAPSIZE=1000
htop on swap enabled RPi3B+.jpg
htop on swap enabled RPi3B+.jpg (84.95 KiB) Viewed 837 times
Raspbian stretch full desktop, chromium with 8 active tabs, and Gimp running
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

User avatar
bonzadog
Posts: 272
Joined: Wed Apr 25, 2012 9:40 am
Location: Rietberg/Germany

Re: /etc/dphys-swapfile CONF_SWAPSIZE Value

Sun Mar 15, 2020 10:12 am

Interesting...thank you. I will try to collate information and read more about this.

Chromium is another google data collection gatherer and so will never be installed on any of my systems.
Firefox runs well on the RPi but I have been informed that Opera will work but one need to compile it. I will try that.

Regarding data collection and security, I have moved my cloud from US and from the UK to the more secure Swedish clouds.

User avatar
rpdom
Posts: 18696
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: /etc/dphys-swapfile CONF_SWAPSIZE Value

Sun Mar 15, 2020 11:26 am

bonzadog wrote:
Sun Mar 15, 2020 10:12 am
Chromium is another google data collection gatherer and so will never be installed on any of my systems.
The Google Chrome browser may well be a "data collection gatherer". The Open Source Chromium Browser is not. It uses the source code from the Chromium browser with the data acquisition code stripped out.

As the source code is freely available anyone can go to check that there is no nasties hiding in there.

Although personally I'm sticking with Firefox on my laptop as it has bad video driver issues with the Chromium browser.
Unreadable squiggle

User avatar
bonzadog
Posts: 272
Joined: Wed Apr 25, 2012 9:40 am
Location: Rietberg/Germany

Re: /etc/dphys-swapfile CONF_SWAPSIZE Value

Sun Mar 15, 2020 11:36 am

rpdom wrote:
Sun Mar 15, 2020 11:26 am
bonzadog wrote:
Sun Mar 15, 2020 10:12 am
Chromium is another google data collection gatherer and so will never be installed on any of my systems.
The Google Chrome browser may well be a "data collection gatherer". The Open Source Chromium Browser is not. It uses the source code from the Chromium browser with the data acquisition code stripped out.

There are those that disagree with you....I take no changes on any google product

As the source code is freely available anyone can go to check that there is no nasties hiding in there.

Although personally I'm sticking with Firefox on my laptop as it has bad video driver issues with the Chromium browser.

LTolledo
Posts: 5319
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: /etc/dphys-swapfile CONF_SWAPSIZE Value

Sun Mar 15, 2020 12:55 pm

...therefore you dont need to set swap... as I think its pointless doing so in your use case...
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Return to “Advanced users”