[opensuse] 10.3 and swap question on 4-GB ram
I helped a friend install 10.3 64-bit on his Q6600 machine that has 4-GB of ram yesterday. Wow was the installation fast. SUSE setup a 2-GB swap space by default. We over road that and made it 4-GB. Is this a bug/oversite or on purpose? If on purpose what is the logic behind that? Cheers, Bob -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Robert Lewis wrote:
I helped a friend install 10.3 64-bit on his Q6600 machine that has 4-GB of ram yesterday. Wow was the installation fast.
SUSE setup a 2-GB swap space by default.
We over road that and made it 4-GB.
Why? If you really need that much virtual memory, you should upgrade your RAM. It doesn't make sense to have such huge swap partitions, your system will be unusable if you need 4 GB swap (well, sort of unusable). And if you really need it at some point, you can always make a swap file which is almost as fast as a swap partition. If you want to use suspend to disk, then of course your swap space should be large enough.
Is this a bug/oversite or on purpose?
Why should it be a bug? The times when swap partitions had to be as big (or bigger) as RAM size are long gone.
If on purpose what is the logic behind that?
There's no need for huge swap partitions unless you want to use suspend to disk. And that's unlikely for a machine that seems to be used as a server. Th. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 10/28/07, Thomas Hertweck
Robert Lewis wrote:
I helped a friend install 10.3 64-bit on his Q6600 machine that has 4-GB of ram yesterday. Wow was the installation fast.
SUSE setup a 2-GB swap space by default.
We over road that and made it 4-GB.
Why?
If you really need that much virtual memory, you should upgrade your RAM. It doesn't make sense to have such huge swap partitions, your system will be unusable if you need 4 GB swap (well, sort of unusable). And if you really need it at some point, you can always make a swap file which is almost as fast as a swap partition.
If you want to use suspend to disk, then of course your swap space should be large enough.
Is this a bug/oversite or on purpose?
Why should it be a bug? The times when swap partitions had to be as big (or bigger) as RAM size are long gone.
If on purpose what is the logic behind that?
There's no need for huge swap partitions unless you want to use suspend to disk. And that's unlikely for a machine that seems to be used as a server.
Th. --
The reason both of us did this is we came from a world in Linux where one always made swap the size of RAM or larger to allow for later ram expansion. I agree swapping to a file is a good way to expand swap down stream. How did SUSE decide to set it to 2-GB and why? Is there any harm doing what we did? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Robert Lewis wrote:
On 10/28/07, Thomas Hertweck
wrote: Robert Lewis wrote:
I helped a friend install 10.3 64-bit on his Q6600 machine that has 4-GB of ram yesterday. Wow was the installation fast.
SUSE setup a 2-GB swap space by default.
We over road that and made it 4-GB.
Why?
If you really need that much virtual memory, you should upgrade your RAM. It doesn't make sense to have such huge swap partitions, your system will be unusable if you need 4 GB swap (well, sort of unusable). And if you really need it at some point, you can always make a swap file which is almost as fast as a swap partition.
If you want to use suspend to disk, then of course your swap space should be large enough.
Is this a bug/oversite or on purpose?
Why should it be a bug? The times when swap partitions had to be as big (or bigger) as RAM size are long gone.
If on purpose what is the logic behind that?
There's no need for huge swap partitions unless you want to use suspend to disk. And that's unlikely for a machine that seems to be used as a server.
Th. --
The reason both of us did this is we came from a world in Linux where one always made swap the size of RAM or larger to allow for later ram expansion. I agree swapping to a file is a good way to expand swap down stream. How did SUSE decide to set it to 2-GB and why?
Is there any harm doing what we did?
Read what Russel Cocker has to say at this link: http://etbe.coker.com.au/2007/09/28/swap-space/ -- Sent from my wired giant hulking workstation Nate Pearlstein - npearl@sgi.com - Product Support Engineer -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Nate Pearlstein wrote:
Read what Russel Cocker has to say at this link:
many lines of "this is not a good idea", but very little proof of this I still don't see what is the problem. The disk space is cheap and if the system don't need swap, it won't use it, so I see only a vaste of disk space... jdd -- http://www.dodin.net http://www.ladepeche.fr/article/2007/10/27/127022-Claire-Dodin-une-Toulousai... -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Robert Lewis wrote:
[...] The reason both of us did this is we came from a world in Linux where one always made swap the size of RAM or larger to allow for later ram expansion.
That doesn't make sense nowadays. When you add more RAM, then you usually need less swap. As I said before, the times when swap space had to be as big as (or even double) the RAM size are long gone.
I agree swapping to a file is a good way to expand swap down stream.
It's an easy way to provide enough virtual memory in those rare circumstances where it might be required. Again, in the good old times swap files where a lot slower than swap partitions, but this does no longer hold with kernel 2.6.
How did SUSE decide to set it to 2-GB and why?
Well, look at the source code of the installation program to find out why it has chosen 2 GB of swap. Maybe it's the upper limit. Having more than that usually does not make much sense.
Is there any harm doing what we did?
There's no harm, it's just a waste of disk space. Th. PS. I don't need and I don't want private copies of list emails! Why would somebody want to receive all emails twice? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
jdd wrote:
[...]
I still don't see what is the problem. The disk space is cheap and if the system don't need swap, it won't use it, so I see only a vaste of disk space...
That much swap space doesn't make sense. If you are happy doing things that don't make sense and want to waste your disk space that's up to you. But others prefer wiser decision making. So did the installation tool. Th. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Friday 2007-10-26 at 11:34 -0700, Robert Lewis wrote:
I helped a friend install 10.3 64-bit on his Q6600 machine that has 4-GB of ram yesterday. Wow was the installation fast.
SUSE setup a 2-GB swap space by default.
We over road that and made it 4-GB.
I would have used 4.5 or 6 :-P
Is this a bug/oversite or on purpose?
Not really.
If on purpose what is the logic behind that?
Dunno, but I know my logic: I want to be able to suspend to disk (hibernate), and to do that we need at least 4 GiB. If you are not going to do that, the default 2GiB is probably just as good. Yast should perhaps have asked the user if he intended to be able to hibernate before suggesting a swap size. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFHJPT7tTMYHG2NR9URApV7AJ96YYvHfkfBz7D/w+OPmRX1uLAp4gCfahXI cfBUH94FV5c2NZtmaarOerU= =BMfY -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 29 October 2007 03:53:26 jdd wrote:
Nate Pearlstein wrote:
Read what Russel Cocker has to say at this link:
many lines of "this is not a good idea", but very little proof of this
I still don't see what is the problem. The disk space is cheap and if the system don't need swap, it won't use it, so I see only a vaste of disk space...
Overloading on swap is not a good idea. As someone has already mentioned, if you've got 4GB of physical RAM and still find you're swapping, then you should add more RAM. One real reason why a large swap file/partition is unhelpful: the kernel still has to maintain memory addresses, and if you have a whopping great big swap file/partition then you have a whopping great big page table that has to be constantly monitored by the kernel. A complete waste of system resources if you ask me... Jon -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 28 October 2007 21:45:46 Carlos E. R. wrote:
Dunno, but I know my logic: I want to be able to suspend to disk (hibernate), and to do that we need at least 4 GiB.
If you are not going to do that, the default 2GiB is probably just as good.
Yast should perhaps have asked the user if he intended to be able to hibernate before suggesting a swap size.
Well, sort of. There's no rule that says the partition hibernation writes to needs to be an active swap partition Or even a swap partition at all Anders -- Madness takes its toll -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, 2007-10-29 at 02:43 +0100, Jonathan Ervine wrote:
On Monday 29 October 2007 03:53:26 jdd wrote:
Nate Pearlstein wrote:
Read what Russel Cocker has to say at this link:
many lines of "this is not a good idea", but very little proof of this
I still don't see what is the problem. The disk space is cheap and if the system don't need swap, it won't use it, so I see only a vaste of disk space...
Overloading on swap is not a good idea. As someone has already mentioned, if you've got 4GB of physical RAM and still find you're swapping, then you should add more RAM. One real reason why a large swap file/partition is unhelpful: the kernel still has to maintain memory addresses, and if you have a whopping great big swap file/partition then you have a whopping great big page table that has to be constantly monitored by the kernel. A complete waste of system resources if you ask me...
Jon
Coincidentally, I just happened to be reading up on SWAP only moments ago in a study guide. In my material, it recommends instead of doubling SWAP to the size of RAM, you should spread SWAP into partitions in multiple disks. Then set the priority in /etc/fstab to 1 for each of the partitions. That way, SWAP runs optimally and the CPU delegates to all SWAP partitions in parallel. In /etc/fstab, you would do something like this, assuming you have two drives on your machine. /dev/sda1 swap swap pri=1 0.0 /dev/sdb1 swap swap pri=1 0.0 Be sure that your drives are of the same speed. I'm only paraphrasing what I was just reading, but it makes sense to me. If anyone else has had experience with this type of optimization, would love to hear more from you! -- ---Bryen--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 2007-10-28 at 15:41 -0400, Nate Pearlstein wrote:
Robert Lewis wrote:
On 10/28/07, Thomas Hertweck
wrote: Robert Lewis wrote:
I helped a friend install 10.3 64-bit on his Q6600 machine that has 4-GB of ram yesterday. Wow was the installation fast.
SUSE setup a 2-GB swap space by default.
We over road that and made it 4-GB.
Why?
If you really need that much virtual memory, you should upgrade your RAM. It doesn't make sense to have such huge swap partitions, your system will be unusable if you need 4 GB swap (well, sort of unusable). And if you really need it at some point, you can always make a swap file which is almost as fast as a swap partition.
If you want to use suspend to disk, then of course your swap space should be large enough.
Is this a bug/oversite or on purpose?
Why should it be a bug? The times when swap partitions had to be as big (or bigger) as RAM size are long gone.
If on purpose what is the logic behind that?
There's no need for huge swap partitions unless you want to use suspend to disk. And that's unlikely for a machine that seems to be used as a server.
Th. --
The reason both of us did this is we came from a world in Linux where one always made swap the size of RAM or larger to allow for later ram expansion. I agree swapping to a file is a good way to expand swap down stream. How did SUSE decide to set it to 2-GB and why?
Is there any harm doing what we did?
Read what Russel Cocker has to say at this link:
OK, 1. If you have 2 or more GB o memory you do not need a RAM x 2 swapper space 2. A swapper space of >2 GB is not need it. 3. If you want to use the swap for hibernation you need a swapper space = RAM + video memory These is all I got from this thread. Q: how do you setup hibernation to use the swap space? I have a thinkpad x40 and x61 Thank you. -=terry=- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Monday 2007-10-29 at 02:54 +0100, Anders Johansson wrote:
Yast should perhaps have asked the user if he intended to be able to hibernate before suggesting a swap size.
Well, sort of. There's no rule that says the partition hibernation writes to needs to be an active swap partition
Or even a swap partition at all
As far as I know, yes, it has to be a swap partition. The kernel has to be told about it when booting: kernel /vmlinuz root=/dev/hdd6 vga=0x317 resume=/dev/hdd7 splash=verbose ^^^^^^ - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFHJdGotTMYHG2NR9URAjsDAKCV3xOqftE3X4PA7nqMviv/6M+CuwCfcZJv cUU64JSNZ3dp27fwBe8XSZs= =0uP/ -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Sunday 2007-10-28 at 21:00 -0500, Bryen wrote:
/dev/sda1 swap swap pri=1 0.0 /dev/sdb1 swap swap pri=1 0.0
Be sure that your drives are of the same speed.
I'm only paraphrasing what I was just reading, but it makes sense to me. If anyone else has had experience with this type of optimization, would love to hear more from you!
That has been known for ages :-p Yes, I use that kind of setting. I have a SuSE 7.3 machine with 32 MiB of ram, and more than half a gigabyte of swap in three partitions. Proves that in Linux there is no limit to how much swap you can use :-P And a year or two ago (SuSE 9.2?) there was a problem with that as the hibernating script failed if there were two swap partition, it could use only one. Now it is happy with two. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFHJdMotTMYHG2NR9URAn7pAKCKxOhIP4XDRBtn1ZIN2Ja002t7jACeObFp KcgRpIAoJfrTpol90uctYgI= =54cj -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Sunday 2007-10-28 at 21:38 -0600, Teruel de Campo MD wrote:
3. If you want to use the swap for hibernation you need a swapper space = RAM + video memory
I don't know for certatin, but could be so.
Q: how do you setup hibernation to use the swap space? I have a thinkpad x40 and x61
It will probably have been setup by Yast from day 1. It is the "resume=..." kernel option. A different thing is whether it works for you or not: it's still a kind of magic or art. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFHJdP4tTMYHG2NR9URAl+QAJ4rVEEK9eyk1CMP35XRIFkNDfcUlQCdG2oq iM1DXgfWJJGu1S3u5qe6ZKs= =/tj4 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Coincidentally, I just happened to be reading up on SWAP only moments ago in a study guide. In my material, it recommends instead of doubling SWAP to the size of RAM, you should spread SWAP into partitions in multiple disks. Then set the priority in /etc/fstab to 1 for each of the partitions. That way, SWAP runs optimally and the CPU delegates to all SWAP partitions in parallel.
In /etc/fstab, you would do something like this, assuming you have two drives on your machine.
/dev/sda1 swap swap pri=1 0.0 /dev/sdb1 swap swap pri=1 0.0
Be sure that your drives are of the same speed.
I'm only paraphrasing what I was just reading, but it makes sense to me. If anyone else has had experience with this type of optimization, would love to hear more from you!
So how would you make SUSE use the swap space for suspend if the size of both swap partitions adds up to the size of RAM? If there were only 1 swap partition, the kernel would know from the GRUB menu entry: kernel /vmlinuz root=/dev/hdd6 vga=0x317 resume=/dev/sda1 splash=verbose Will it work to have two resume sections like this: kernel /vmlinuz root=/dev/hdd6 vga=0x317 resume=/dev/sda1 resume=/dev/sdb1 splash=verbose -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Monday 2007-10-29 at 23:49 +0800, Chee How Chua wrote:
In /etc/fstab, you would do something like this, assuming you have two drives on your machine.
/dev/sda1 swap swap pri=1 0.0 /dev/sdb1 swap swap pri=1 0.0
...
So how would you make SUSE use the swap space for suspend if the size of both swap partitions adds up to the size of RAM?
If there were only 1 swap partition, the kernel would know from the GRUB menu entry:
kernel /vmlinuz root=/dev/hdd6 vga=0x317 resume=/dev/sda1 splash=verbose
Will it work to have two resume sections like this:
kernel /vmlinuz root=/dev/hdd6 vga=0x317 resume=/dev/sda1 resume=/dev/sdb1 splash=verbose
Now, this is an interesting question. I have that situation, but my "resume=" entries only lists one of the two swap partitions. It certainly works, but I can't say if the hibernation data is stored on both drives o a single one, I don't know how to determine that (any one of my swaps is bigger than my ram). My guess is that hibernating occurs in two stages. First, tasks are stopped and swapped out. At this time, the kernel is fully running, so it uses both swaps. Later, it takes a "photo" of the remaining used ram and this is copied to swap - and this might be only one of them. However... a year or two ago, the system would refuse to hibernate if there wasn't a single active swap (I mean, if it found two swaps). Now it doesn't. So, it might somehow use both... :-? What I can tell is that in normal use, both partitions are equally filled (or equally empty). A note on hibernation: after waking up, some memory remains for ever, it seems, in swap, so that there is in fact more ram available than before hibernating. A nice side effect. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFHJiy8tTMYHG2NR9URAjTEAJ9+wz4KSg2nkTt0A24yhjuPPrq5LACgkto9 AQb4YvJzby1iUUlCPiQ/9cg= =JyQ3 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Bryen wrote:
[...] Coincidentally, I just happened to be reading up on SWAP only moments ago in a study guide. In my material, it recommends instead of doubling SWAP to the size of RAM, you should spread SWAP into partitions in multiple disks. [...] I'm only paraphrasing what I was just reading, but it makes sense to me. If anyone else has had experience with this type of optimization, would love to hear more from you!
This is nothing new. It's also mentioned (although not as obvious as it could be) in the man page: Swap pages are allocated from areas in priority order, highest priority first. For areas with different priorities, a higher-priority area is exhausted before using a lower-priority area. If two or more areas have the same priority, and it is the highest priority available, pages are allocated on a round-robin basis between them. (man 2 swapon) For further swap tuning, you should also have a look at "swapiness". Th. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, 2007-10-29 at 19:55 +0100, Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The Monday 2007-10-29 at 23:49 +0800, Chee How Chua wrote:
In /etc/fstab, you would do something like this, assuming you have two drives on your machine.
/dev/sda1 swap swap pri=1 0.0 /dev/sdb1 swap swap pri=1 0.0
...
So how would you make SUSE use the swap space for suspend if the size of both swap partitions adds up to the size of RAM?
If there were only 1 swap partition, the kernel would know from the GRUB menu entry:
kernel /vmlinuz root=/dev/hdd6 vga=0x317 resume=/dev/sda1 splash=verbose
Will it work to have two resume sections like this:
kernel /vmlinuz root=/dev/hdd6 vga=0x317 resume=/dev/sda1 resume=/dev/sdb1 splash=verbose
Now, this is an interesting question.
I have that situation, but my "resume=" entries only lists one of the two swap partitions. It certainly works, but I can't say if the hibernation data is stored on both drives o a single one, I don't know how to determine that (any one of my swaps is bigger than my ram).
My guess is that hibernating occurs in two stages. First, tasks are stopped and swapped out. At this time, the kernel is fully running, so it uses both swaps. Later, it takes a "photo" of the remaining used ram and this is copied to swap - and this might be only one of them.
However... a year or two ago, the system would refuse to hibernate if there wasn't a single active swap (I mean, if it found two swaps). Now it doesn't. So, it might somehow use both... :-?
What I can tell is that in normal use, both partitions are equally filled (or equally empty).
A note on hibernation: after waking up, some memory remains for ever, it seems, in swap, so that there is in fact more ram available than before hibernating. A nice side effect.
In all this thread we have been directing our attention to the swap size and it effect or not in virtual memory when we are using large RAM, also its effect in hibernation. I think another important point it is the need of a large swap when you get a core dump. If a kernel fault cause the core to dump, this dump go to the swap and avoids corrupting the file system. I know kernel crashes are rare. My approach is to keep a large swap. I have to 2GB of RAM and 4GB swap, until recently swap was not use and very seldom I needed more than 1.4 GB of RAM. Since I started to use beryl and now compiz-fusion : tdec@amd:~> free -mt total used free shared buffers cached Mem: 2014 1968 46 0 32 348 -/+ buffers/cache: 1587 426 Swap: 4102 703 3398 Total: 6117 2672 3445 So I may have to add more RAM and perhaps increase the swap :) -=terry=- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (10)
-
Anders Johansson
-
Bryen
-
Carlos E. R.
-
Chee How Chua
-
jdd
-
Jonathan Ervine
-
Nate Pearlstein
-
Robert Lewis
-
Teruel de Campo MD
-
Thomas Hertweck