Hello,
I am going to buy new laptop with two drives, one SSD and one HDD and I want to place swap partition on HDD which will be most time unused and therefore spinned down. Problem is, that I don't know, if or how often is kernel touching swap space even if there is lot of free memory and thus spinning HDD up.
Thank you in advance
Martin Šťastný wrote:
Hello,
I am going to buy new laptop with two drives, one SSD and one HDD and I want to place swap partition on HDD which will be most time unused and therefore spinned down. Problem is, that I don't know, if or how often is kernel touching swap space even if there is lot of free memory and thus spinning HDD up.
You should partition your drives anyway: a small, like 1G, partition for /boot. For swap, the old Received Wisdom was 2-2.5 times RAM; these days, it's "make swap to be 2G (for emergencies). Put swap on the SSD, I *guess*... if it's enterprise grade, and not "consumer grade", which will eventually give up with too many writes.
mark
On 07/23/2013 01:22 PM, Martin Šťastný wrote:
how often is kernel touching swap space
There's a kernel tunable called "swappiness" [1] to control that. You can add an entry in /etc/sysctl.conf like this:
vm.swappiness=0
...and the kernel will avoid, as much as it can, to use swap.
HTH, Jorge
Thank you for you responses,
first of all I need same amount of swap space as of memory, because I want to use hibernation. Problem of placing swap partition on SSD is not with too many writes, but with to much space used for nothing (in my case 8 GB, 16 GB in not so far future). I know about "swappiness" kernel tunable, but I guess it has nothing to do with how often is partition "simply touched for nothing" and therefore hard drive is spinned up. For example - if I set HDD to spin down after two minutes and kernel will touch swap approximately every five minutes, it means that hard drive will be spinned up 120 times every day (10 hours of power on), 43 800 cycles per year which will definitely wreck my HDD :-(.
2013/7/23 Jorge Fábregas jorge.fabregas@gmail.com
On 07/23/2013 01:22 PM, Martin Šťastný wrote:
how often is kernel touching swap space
There's a kernel tunable called "swappiness" [1] to control that. You can add an entry in /etc/sysctl.conf like this:
vm.swappiness=0
...and the kernel will avoid, as much as it can, to use swap.
HTH, Jorge
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
You know that you don't need a swap partition for hibernation? s2disk(uswsusp) makes a swapfile on your hdd prior to hibernating and only activates it for hibernation purposes, so you don't have to have swap active all the time.
On 2013-07-23 20:28, Martin Šťastný wrote:
Thank you for you responses,
first of all I need same amount of swap space as of memory, because I want to use hibernation. Problem of placing swap partition on SSD is not with too many writes, but with to much space used for nothing (in my case 8 GB, 16 GB in not so far future). I know about "swappiness" kernel tunable, but I guess it has nothing to do with how often is partition "simply touched for nothing" and therefore hard drive is spinned up. For example - if I set HDD to spin down after two minutes and kernel will touch swap approximately every five minutes, it means that hard drive will be spinned up 120 times every day (10 hours of power on), 43 800 cycles per year which will definitely wreck my HDD :-(.
2013/7/23 Jorge Fábregas jorge.fabregas@gmail.com
On 07/23/2013 01:22 PM, Martin Šťastný wrote:
how often is kernel touching swap space
There's a kernel tunable called "swappiness" [1] to control that. You can add an entry in /etc/sysctl.conf like this:
vm.swappiness=0
...and the kernel will avoid, as much as it can, to use swap.
HTH, Jorge
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos