I have 256MB ram and a 502MB swap, and want to increase to 384MB ram, [i know, i know it's an old machine]. I've read in the RH manual and else where that double the amount of ram is "right". If I want more swap but don't have any unpartitioned space left, what are my options? (I do, however, have lots of free space on my drive).
TIA
-Craig
On Sat, 2004-03-13 at 16:44, Craig Thomas wrote:
I have 256MB ram and a 502MB swap, and want to increase to 384MB ram, [i know, i know it's an old machine]. I've read in the RH manual and else where that double the amount of ram is "right". If I want more swap but don't have any unpartitioned space left, what are my options? (I do, however, have lots of free space on my drive).
TIA
-Craig
If you remove the swap partition, it should swap to one of your linux partitions. You may need to confirm this. Otherwise, you might want to increase the swap partition size. The whole twice the amount of RAM you have is a rule of thumb. If you do not expect to be swapping much, i.e., you are not doing any intensive graphics work, then you will hardly use your swap anyway. From my experience, I have rarely needed the swap partition.
Maynard Kuona said:
On Sat, 2004-03-13 at 16:44, Craig Thomas wrote:
I have 256MB ram and a 502MB swap, and want to increase to 384MB ram, [i know, i know it's an old machine]. I've read in the RH manual and else where that double the amount of ram is "right". If I want more swap but don't have any unpartitioned space left, what are my options? (I do, however, have lots of free space on my drive).
TIA
-Craig
If you remove the swap partition, it should swap to one of your linux partitions.
No, if you remove the swap partition you don't have any swap.
You may need to confirm this. Otherwise, you might want to increase the swap partition size.
Another option would be to use swap files. http://tldp.org/LDP/sag/html/x1790.html
I haven't tried it personally, so YMMV.
The whole twice the amount of RAM you have is a rule of thumb. If you do not expect to be swapping much, i.e., you are not doing any intensive graphics work, then you will hardly use your swap anyway.
That is a very general statement that is wrong in a lot of cases.
You may need to confirm this. Otherwise, you might want to increase the swap partition size.
Another option would be to use swap files. http://tldp.org/LDP/sag/html/x1790.html
I haven't tried it personally, so YMMV.
The whole twice the amount of RAM you have is a rule of thumb. If you do not expect to be swapping much, i.e., you are not doing any intensive graphics work, then you will hardly use your swap anyway.
That is a very general statement that is wrong in a lot of cases.
If he does not do anything too intensive I am sure 502MB is enough swap. Depends on configuration I suppose.
On Sat, 2004-03-13 at 11:14, William Hooper wrote:
Another option would be to use swap files. http://tldp.org/LDP/sag/html/x1790.html
Thank you. After reading chapter 7, I think I don't need more swap space. Below is the output of free when running (but hardly using) all the apps I generally run at once:
total used free shared buffers cached Mem: 385032 379860 5172 0 11840 132144 -/+ buffers/cache: 235876 149156 Swap: 514072 11848 502224
This means I am using very little of my swap space and therefore I don't need more. Is this right or am I off base?
TIA
-Craig
That is a very general statement that is wrong in a lot of cases.
Craig Thomas wrote:
Thank you. After reading chapter 7, I think I don't need more swap space. Below is the output of free when running (but hardly using) all the apps I generally run at once:
total used free shared buffers
cached Mem: 385032 379860 5172 0 11840 132144 -/+ buffers/cache: 235876 149156 Swap: 514072 11848 502224
This means I am using very little of my swap space and therefore I don't need more. Is this right or am I off base?
Swap = 2X installed RAM is an anachronism dating back to when memory cost $50US or more per megabyte and only servers routinely had more than 16 megabytes. Ordinary workstation users won't often find very much of the total available in use. My KDE box up 53 days with 128M of installed RAM currently shows 57396 of 522072 total swap in use.
Another thing to keep in mind is that the memory manager in the early 2.4 kernels worked best with plenty of extra swap. But, because of many complaints, it was revamped.
One of the optimizations that, though it was helpful in certain cases, caused worse problems in other cases, such as low ram or low swap environments.
-----Original Message----- From: fedora-list-bounces@redhat.com [mailto:fedora-list-bounces@redhat.com] On Behalf Of Felix Miata Sent: Saturday, March 13, 2004 12:00 PM To: fedora-list@redhat.com Subject: Re: new memory = more swap?
Craig Thomas wrote:
Thank you. After reading chapter 7, I think I don't need more swap space. Below is the output of free when running (but hardly using) all the apps I generally run at once:
total used free shared buffers
cached Mem: 385032 379860 5172 0 11840 132144 -/+ buffers/cache: 235876 149156 Swap: 514072 11848 502224
This means I am using very little of my swap space and therefore I don't need more. Is this right or am I off base?
Swap = 2X installed RAM is an anachronism dating back to when memory cost $50US or more per megabyte and only servers routinely had more than 16 megabytes. Ordinary workstation users won't often find very much of the total available in use. My KDE box up 53 days with 128M of installed RAM currently shows 57396 of 522072 total swap in use.
On Sat, Mar 13, 2004 at 04:58:45PM +0200, Maynard Kuona wrote:
Reply-To: For users of Fedora Core releases fedora-list@redhat.com
On Sat, 2004-03-13 at 16:44, Craig Thomas wrote:
I have 256MB ram and a 502MB swap, and want to increase to 384MB ram, [i know, i know it's an old machine]. I've read in the RH manual and else where that double the amount of ram is "right". If I want more swap but don't have any unpartitioned space left, what are my options? (I do, however, have lots of free space on my drive).
....
have is a rule of thumb. If you do not expect to be swapping much, i.e., you are not doing any intensive graphics work, then you will hardly use your swap anyway. From my experience, I have rarely needed the swap partition.
....
Craig,
Do nothing different for now.
Since you have more DRAM you will need to swap less not more ;-)
If you later find you need more swap space you can add a "swap to file" swap resource as disk space permits (swap + swap_file=total_swap; total_swap+DRAM=total_VM).
The advantage of a modest swap partition and later adding swap files is that a big unused swap space on disk is wasteful. Swap files can be added or removed as needed without repartitioning the disk.
Since you have the disk space -- you can try swap to files. Note that additions can be done without a reboot.
Swap IO to disk is so slow in comparison to DRAM that swap is painful. Over the years the rules of thumb have shifted from +4xRAM to ~1x RAM or less. The reason is that processors are +1000 fold faster but disks keep on spinning close to the older rates.
Big computational server configurations with multiple GB of RAM and TB of disk and tape have other issues.
To understand the 2x rule Google search about for "virtual memory", fork(), exec(), "copy on write". I think 2x is still a good rule for building a new box.
On Sat, Mar 13, 2004 at 09:44:06AM -0500, Craig Thomas wrote:
I have 256MB ram and a 502MB swap, and want to increase to 384MB ram, [i know, i know it's an old machine]. I've read in the RH manual and else where that double the amount of ram is "right". If I want more swap but don't have any unpartitioned space left, what are my options? (I do, however, have lots of free space on my drive).
In theory, yes, you ought to increase swap. IN practice, though, for machines that just get light use (like most desktop or home systems) it shouldn't matter. I've never gone even halfway into the swap on this machine from which I'm mailing this. And at work, i've got a RHEL WS 2.1 box with a gig of RAM that started out at 512, so it has a one-gig swap space. It never but never uses more than a hundred megs of swap, so I've not bothered to dedicate more space to it.
Howeveer, if you feel compelled to dedicate the disk space, you can allocate some space in a file and use that as swap (if you don't have more unused partition space on the drive to use). Check out the man pages for 'mkswap' and 'swapon, which show you how to do it.
I doubt you need to increase swap unless you already experience a lack of swap space. I have 512M RAM and only 256M swap space, but i've never had more that 50% of swap space used.
Craig Thomas wrote:
I have 256MB ram and a 502MB swap, and want to increase to 384MB ram, [i know, i know it's an old machine]. I've read in the RH manual and else where that double the amount of ram is "right". If I want more swap but don't have any unpartitioned space left, what are my options? (I do, however, have lots of free space on my drive).
TIA
-Craig
On Fri, Mar 19, 2004 at 09:20:56PM +0200, thedogfarted wrote:
I doubt you need to increase swap unless you already experience a lack of swap space. I have 512M RAM and only 256M swap space, but i've never had more that 50% of swap space used.
Craig Thomas wrote:
I have 256MB ram and a 502MB swap, and want to increase to 384MB ram, [i know, i know it's an old machine]. I've read in the RH manual and else where that double the amount of ram is "right". If I want more swap but don't have any unpartitioned space left, what are my options? (I do, however, have lots of free space on my drive).
TIA
-Craig
We seem to be in a size war. 512MB of Ram makes a big difference over 256MB of Ram. Again the speed of the processor makes a difference. Also how much you have installed.
I have 1700+ Athlon XP. Before i moved from RH9 to Fedora, i had 1G swap space as written in RH manual. I installed RH9 without any knowledge of Linux and small knowledge of UNIX, so i decided to follow the manual. As i have small hdd, those 3/4 G is quite a lot for me :)
Aaron Konstam wrote:
On Fri, Mar 19, 2004 at 09:20:56PM +0200, thedogfarted wrote:
I doubt you need to increase swap unless you already experience a lack of swap space. I have 512M RAM and only 256M swap space, but i've never had more that 50% of swap space used.
Craig Thomas wrote:
I have 256MB ram and a 502MB swap, and want to increase to 384MB ram, [i know, i know it's an old machine]. I've read in the RH manual and else where that double the amount of ram is "right". If I want more swap but don't have any unpartitioned space left, what are my options? (I do, however, have lots of free space on my drive).
TIA
-Craig
We seem to be in a size war. 512MB of Ram makes a big difference over 256MB of Ram. Again the speed of the processor makes a difference. Also how much you have installed.
Depending on memory you can even get away without swap. What you run will determine how much you really need. My system has 392M Ram and 400M of swap, and even compiling kernels (with -j4 for those who understand) barely touches swap. Swap is mostly used for static (sleeping) programs -- those not in active use -- and for a desktop with a large block of memory is typically -- from my point of view -- of nominal use. I'll get 1000 emails telling me I'm wrong I'll bet.
Craig Thomas wrote:
I have 256MB ram and a 502MB swap, and want to increase to 384MB ram, [i know, i know it's an old machine]. I've read in the RH manual and else where that double the amount of ram is "right". If I want more swap but don't have any unpartitioned space left, what are my options? (I do, however, have lots of free space on my drive).
The advice that swap=2(RAM) dates from the time when RAM was expensive and few user machines had more than 64MB.
These days most people have plenty of RAM and thus require less swap space. I have 384MB RAM and a 256MB swap partition that is seldom more than 25% used.
I concur. It is unlikely that you will need/want to increase your amount of swap. You can monitor your swap usage if you feel that your machine is lacking, and increase it if the utilization is high.
-Leon
Craig Thomas wrote:
I have 256MB ram and a 502MB swap, and want to increase to 384MB ram, [i know, i know it's an old machine]. I've read in the RH manual and else where that double the amount of ram is "right". If I want more swap but don't have any unpartitioned space left, what are my options? (I do, however, have lots of free space on my drive).
The advice that swap=2(RAM) dates from the time when RAM was expensive and few user machines had more than 64MB.
These days most people have plenty of RAM and thus require less swap space. I have 384MB RAM and a 256MB swap partition that is seldom more than 25% used.
--
-John (JohnThompson@new.rr.com)
-- fedora-list mailing list fedora-list@redhat.com To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
On 03/25/2004 01:50 PM, John Thompson wrote:
Craig Thomas wrote:
I have 256MB ram and a 502MB swap, and want to increase to 384MB ram, [i know, i know it's an old machine]. I've read in the RH manual and else where that double the amount of ram is "right". If I want more swap but don't have any unpartitioned space left, what are my options? (I do, however, have lots of free space on my drive).
The advice that swap=2(RAM) dates from the time when RAM was expensive and few user machines had more than 64MB.
These days most people have plenty of RAM and thus require less swap space. I have 384MB RAM and a 256MB swap partition that is seldom more than 25% used.
Is it still also true, though, that swap should at a minimum = RAM (this is knowledge that dates back to early versions of SCO, which was weird anyway, I know)? If so, then having more swap than RAM may be worthwhile anyway, because you probably have plenty of disk space, and you might add RAM later (and you won't have to repartition at that point if you have extra swap).
I realize it's also a lot easier to repartition these days, too. But I still like to avoid it.
Can you have too much swap? (Disk space issues aside). If I have 512 Mb of RAM, and set up a 1Gb swap partition, did I make a mistake?
On Thu, 2004-03-25 at 13:09, Matt Morgan wrote:
On 03/25/2004 01:50 PM, John Thompson wrote:
Craig Thomas wrote:
I have 256MB ram and a 502MB swap, and want to increase to 384MB ram, [i know, i know it's an old machine]. I've read in the RH manual and else where that double the amount of ram is "right". If I want more swap but don't have any unpartitioned space left, what are my options? (I do, however, have lots of free space on my drive).
The advice that swap=2(RAM) dates from the time when RAM was
expensive and few user machines had more than 64MB.
These days most people have plenty of RAM and thus require less swap
space. I have 384MB RAM and a 256MB swap partition that is seldom more than 25% used.
Is it still also true, though, that swap should at a minimum = RAM (this is knowledge that dates back to early versions of SCO, which was weird anyway, I know)? If so, then having more swap than RAM may be worthwhile anyway, because you probably have plenty of disk space, and you might add RAM later (and you won't have to repartition at that point if you have extra swap).
I realize it's also a lot easier to repartition these days, too. But I still like to avoid it.
Can you have too much swap? (Disk space issues aside). If I have 512 Mb of RAM, and set up a 1Gb swap partition, did I make a mistake?
I'm not sure that it would be a mistake. I suspect that the answer will be to a large extent specific to the use of the system such as what apps do you run, how many apps simultaneously, are you compiling apps, is this a server or workstation, what services do you run. Things like that.
My older i8200 Dell laptop had 1GB of RAM and a 1GB swap. There were times when perhaps 30-40% of the swap space was in use.
My new Dell i5150 laptop has 2GB of RAM, and I rarely ever see more than 30-50 MB of swap in use and it is used largely in the same way as the i8200 was. As I am typing this, it is 0 MB in use.
The guidelines are just that, guidelines. You need to have a better feel for your system's utilization and based upon that, adjust accordingly. Obviously, the more swapping that takes place, the slower the system response will be in general.
HTH,
Marc Schwartz
I have 1 GB RAM on my Linux box, and 2 GB swap (0 of which is used). But with 260GB of disk space on the computer, why not? I may want to run a program that uses 2 GB sometime.
-----Original Message----- From: fedora-list-bounces@redhat.com [mailto:fedora-list-bounces@redhat.com] On Behalf Of Matt Morgan Sent: Thursday, March 25, 2004 1:09 PM To: For users of Fedora Core releases Subject: Re: new memory = more swap?
On 03/25/2004 01:50 PM, John Thompson wrote:
Craig Thomas wrote:
I have 256MB ram and a 502MB swap, and want to increase to 384MB ram, [i know, i know it's an old machine]. I've read in the RH manual and else where that double the amount of ram is "right". If I want more swap but don't have any unpartitioned space left, what are my options?
(I do, however, have lots of free space on my drive).
The advice that swap=2(RAM) dates from the time when RAM was expensive and few user machines had more than 64MB.
These days most people have plenty of RAM and thus require less swap space. I have 384MB RAM and a 256MB swap partition that is seldom more
than 25% used.
Is it still also true, though, that swap should at a minimum = RAM (this
is knowledge that dates back to early versions of SCO, which was weird anyway, I know)? If so, then having more swap than RAM may be worthwhile
anyway, because you probably have plenty of disk space, and you might add RAM later (and you won't have to repartition at that point if you have extra swap).
I realize it's also a lot easier to repartition these days, too. But I still like to avoid it.
Can you have too much swap? (Disk space issues aside). If I have 512 Mb of RAM, and set up a 1Gb swap partition, did I make a mistake?
Kevin Krieser wrote:
I have 1 GB RAM on my Linux box, and 2 GB swap (0 of which is used). But with 260GB of disk space on the computer, why not? I may want to run a program that uses 2 GB sometime.
-----Original Message----- From: fedora-list-bounces@redhat.com [mailto:fedora-list-bounces@redhat.com] On Behalf Of Matt Morgan Sent: Thursday, March 25, 2004 1:09 PM To: For users of Fedora Core releases Subject: Re: new memory = more swap?
On 03/25/2004 01:50 PM, John Thompson wrote:
Craig Thomas wrote:
I have 256MB ram and a 502MB swap, and want to increase to 384MB ram, [i know, i know it's an old machine]. I've read in the RH manual and else where that double the amount of ram is "right". If I want more swap but don't have any unpartitioned space left, what are my options?
(I do, however, have lots of free space on my drive).
The advice that swap=2(RAM) dates from the time when RAM was expensive and few user machines had more than 64MB.
These days most people have plenty of RAM and thus require less swap space. I have 384MB RAM and a 256MB swap partition that is seldom more
than 25% used.
Is it still also true, though, that swap should at a minimum = RAM (this
is knowledge that dates back to early versions of SCO, which was weird anyway, I know)? If so, then having more swap than RAM may be worthwhile
anyway, because you probably have plenty of disk space, and you might add RAM later (and you won't have to repartition at that point if you have extra swap).
I realize it's also a lot easier to repartition these days, too. But I still like to avoid it.
Can you have too much swap? (Disk space issues aside). If I have 512 Mb of RAM, and set up a 1Gb swap partition, did I make a mistake?
I don't think so. The old ROT (rule-of-thumb) was to set up swap to be twice your system RAM, but it was subject to all kinds of tweaks. With RAM being fairly cheap now, it's not so necessary. However, if your system starts to use swap a lot, then it's time to buy more RAM. Once it starts swapping, your system will slow to a crawl. ---------------------------------------------------------------------- - Rick Stevens, Senior Systems Engineer rstevens@vitalstream.com - - VitalStream, Inc. http://www.vitalstream.com - - - - "Microsoft is a cross between The Borg and the Ferengi. - - Unfortunately they use Borg to do their marketing and Ferengi to - - do their programming." -- Simon Slavin - ----------------------------------------------------------------------
Kevin Krieser wrote:
I have 1 GB RAM on my Linux box, and 2 GB swap (0 of which is used). But with 260GB of disk space on the computer, why not? I may want to run a program that uses 2 GB sometime.
In my experience, using a large database and a complex query is likely the only time that large amounts of swap will be used.
On Thu, 25 Mar 2004 17:50:37 -0600 Kevin Krieser kkrieser@lcisp.com wrote:
I have 1 GB RAM on my Linux box, and 2 GB swap (0 of which is used). But with 260GB of disk space on the computer, why not? I may want to run a program that uses 2 GB sometime.
I'm sure that won't be a problem. FWiW, I have 260GB disk space (5x47GB RAID array and 2x20GB single drives) and have never used all the 256MB swap partition I have.
On Thursday 25 March 2004 11:09 am, Matt Morgan wrote:
Is it still also true, though, that swap should at a minimum = RAM (this is knowledge that dates back to early versions of SCO, which was weird anyway, I know)?
That recommendation was given because in case of a panic the kernel will attempt to dump it's memory to swap for later examination.
As far as I know the linux kernel still does this; I'll try to find out from someone who definitely knows.
So you want at least as much swap as memory if you're ever going to look at a dump after a panic.
Jeff
On Thursday 25 March 2004 11:09 am, Matt Morgan wrote:
Is it still also true, though, that swap should at a minimum = RAM (this is knowledge that dates back to early versions of SCO, which was weird anyway, I know)? If so, then having more swap than RAM may be worthwhile anyway, because you probably have plenty of disk space, and you might add RAM later (and you won't have to repartition at that point if you have extra swap).
Matt,
I passed your question on to a fairly technical linux list, the linux list at the University of Florida, and got a response from a gent who's probably fairly knowledgeable (http://www.tech9.net/rml/); he wrote:
<snip> It used to be the case (early 2.4 series) that swap had to be twice physical RAM. That limitation has since been removed and swap can be any size. </snip>
I also asked him if the linux kernel dumps memory to swap in the event of a panic. I wrote:
Having used SCO xenix and unix back in the days when SCO was a real company, I recall the reason was because in case of a panic the kernel would attempt to dump memory to swap space for later examination.
Does anyone know if the linux kernel does that or ever did?
His response:
<snip> Nope, never did. </snip>
I also got back another response (from a second gent) to your question as to whether swap should at least equal memory, and got back:
<snip> This is a throwback to operating systems that required that every page of ram have a page of swap tied to it. That guideline has been obsolete for at least 10 years. </snip>
You also asked:
Can you have too much swap? (Disk space issues aside). If I have 512 Mb of RAM, and set up a 1Gb swap partition, did I make a mistake?
And in response the same (second) gent also wrote:
<snip> You should set your swap so that RAM+swap = max memory you expect to use. Of course, that's hard to predict. On the other hand, you have to make sure to set your swap low enough that when you're just running too many programs the operating system will kill them, rather than enter thrashing hell. It's a judgement call. </snip>
I think we've gotten some good advice here <smile>. I'm going to go with it.
Jeff