Difference between revisions of "Talk:Swap"

From ArchWiki
Jump to: navigation, search
(advantages of usb pendrive swap disputed: Done.)
(systemd-swap: re)
 
(24 intermediate revisions by 9 users not shown)
Line 1: Line 1:
== <s> advantages of usb pendrive swap disputed </s> ==
+
== <s>Swap check</s> ==
  
First of all, USB 2.0 has a practical limit of about 25 MB/sec throughput, no matter what kind of device is on the other end. Your internal hard drive can probably make at least 70 MB/sec, and nearly all modern drives can read/write faster than that.
+
It could be interisting to have a way to check the swap is functional after a swapon. {{unsigned|09:41, 6 August 2016‎|Louson}}
  
access time is lower than traditional HD
+
:If swapon hasn't reported any errors, then it is functional. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 10:27, 6 August 2016 (UTC)
  
Definitely true for "real" SSD's, but usually not for USB flash drives. Most cheaper flash chips actually have slower than HD read/write performance; high-performance SSD's achieve that by being massively interleaved so that a read or write is parallel over many chips (like RAID-0 for flash). Cheap flash drives don't do that, and often their controller is so cheap that even seek time is slower than a spinning HD (try it sometime -- take a directory of many tiny files and try to randomly read them. It'll go faster on the HD.).
+
== <s>Swappiness</s> ==
  
avoid power on HD when is in stand-by
+
sysctl vm.swappiness=10
  
Um, what? Hard drives are always turned off in standby. They're a persistent storage device, so they don't need power to maintain what was written to them. *RAM* needs to stay on and be refreshed, but that's going to be true no matter what you use for swap. If your laptop isn't spinning down the hard drive when you're in sleep mode, there's something wrong with your power management software/firmware and it's not actually making it into sleep mode. (If this is happening, it's also dangerous -- spinning disks don't like being jostled, and most people put their laptops to sleep when they're going on the move.)
+
does not work for me
  
USB pendrives are cheaper than HD (meaning: you can't get a $5 HDD, price per gigabyte is obviously much higher for flash drives)
+
sysctl -w vm.swappiness=10
  
True you can't get a $5 HDD, but you're much better off putting your user data (pictures, documents, music, etc.) on that $5 flash drive than your swap. If you're out of space and need to free up 2 gigs for more swap space, buy the $5 flash drive, move 2 GB of your stuff onto it, then put your swap partition on the hard drive. It'll be way faster.
+
works {{Unsigned|00:24, 12 September 2016‎|Shimoda}}
[[User:Thetrivialstuff|Thetrivialstuff]] 17:15, 7 January 2012 (EST)
+
 
:Of course you're right, I suggest moving the ADVANTAGES/DISADVANTAGES part at the top of the section and rewriting it with your considerations. I wouldn't recommend just removing the section, since the Arch philosophy aims to give the end user the freedom of choice. -- [[User:Kynikos|Kynikos]] 07:54, 8 January 2012 (EST)
+
:What is your shell? -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 12:13, 12 September 2016 (UTC)
:: Done. Show DISADVANTAGES first. [[User:Fengchao|Fengchao]] 12:16, 20 March 2012 (EDT)
+
 
 +
==gets swap really still actived twice by systemd?==
 +
There is a section about systemd trying to activate swap twice, and several ideas how to work around the error message which appears due to the second attmept to swapon.
 +
Is it still an issue?
 +
I think Lennart fixed this maybe:
 +
https://lists.freedesktop.org/archives/systemd-devel/2015-January/027521.html
 +
and the following mails...
 +
[[User:Mearon|Mearon]] ([[User talk:Mearon|talk]]) 05:45, 22 November 2016 (UTC)
 +
 
 +
:I'm sorry, where is the section? -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 07:52, 22 November 2016 (UTC)
 +
 
 +
:: Sorry for not providing a Link. It's here: https://wiki.archlinux.org/index.php/Swap#Activation_by_systemd [[User:Mearon|Mearon]] ([[User talk:Mearon|talk]]) 14:21, 22 November 2016 (UTC)
 +
 
 +
:::Well, the first part of the section sounds right, but the second might be outdated as you indicate, so I've [https://wiki.archlinux.org/index.php?title=Swap&diff=457718&oldid=456355 flagged it]. I can't test the behaviour now, let's see if somebody can... -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 16:43, 24 November 2016 (UTC)
 +
 
 +
== systemd-swap ==
 +
 
 +
Can we add more documentation on what this is? How it works? What's the difference between Swap File Universal and Swap File Chunked? Do we need to activate both zram and zswap? Do we need both swapfu and swapfc? When would we want a certain configuration? Where is the swap file located? Can we use this to enable hibernation?
 +
 
 +
{{unsigned|16:41, 11 January 2017‎|An2quo}}
 +
 
 +
:That information seriously belongs to https://github.com/Nefelim4ag/systemd-swap -- not here, since they are just details for the script. We already describe the background info in [[Swap]], [[Zswap]], [[Improving_performance#Zram_or_zswap]] and [[Power_management/Suspend_and_hibernate#Hibernation]], your questions can be answered by simply reading the script. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 16:59, 11 January 2017 (UTC)

Latest revision as of 17:00, 11 January 2017

Swap check

It could be interisting to have a way to check the swap is functional after a swapon. —This unsigned comment is by Louson (talk) 09:41, 6 August 2016‎. Please sign your posts with ~~~~!

If swapon hasn't reported any errors, then it is functional. -- Lahwaacz (talk) 10:27, 6 August 2016 (UTC)

Swappiness

sysctl vm.swappiness=10

does not work for me

sysctl -w vm.swappiness=10

works —This unsigned comment is by Shimoda (talk) 00:24, 12 September 2016‎. Please sign your posts with ~~~~!

What is your shell? -- Lahwaacz (talk) 12:13, 12 September 2016 (UTC)

gets swap really still actived twice by systemd?

There is a section about systemd trying to activate swap twice, and several ideas how to work around the error message which appears due to the second attmept to swapon. Is it still an issue? I think Lennart fixed this maybe: https://lists.freedesktop.org/archives/systemd-devel/2015-January/027521.html and the following mails... Mearon (talk) 05:45, 22 November 2016 (UTC)

I'm sorry, where is the section? -- Lahwaacz (talk) 07:52, 22 November 2016 (UTC)
Sorry for not providing a Link. It's here: https://wiki.archlinux.org/index.php/Swap#Activation_by_systemd Mearon (talk) 14:21, 22 November 2016 (UTC)
Well, the first part of the section sounds right, but the second might be outdated as you indicate, so I've flagged it. I can't test the behaviour now, let's see if somebody can... -- Lahwaacz (talk) 16:43, 24 November 2016 (UTC)

systemd-swap

Can we add more documentation on what this is? How it works? What's the difference between Swap File Universal and Swap File Chunked? Do we need to activate both zram and zswap? Do we need both swapfu and swapfc? When would we want a certain configuration? Where is the swap file located? Can we use this to enable hibernation?

—This unsigned comment is by An2quo (talk) 16:41, 11 January 2017‎. Please sign your posts with ~~~~!

That information seriously belongs to https://github.com/Nefelim4ag/systemd-swap -- not here, since they are just details for the script. We already describe the background info in Swap, Zswap, Improving_performance#Zram_or_zswap and Power_management/Suspend_and_hibernate#Hibernation, your questions can be answered by simply reading the script. -- Lahwaacz (talk) 16:59, 11 January 2017 (UTC)