vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have standard RH9 Linux with standard ext3 filesystem. I have 512 MB of RAM and plan to go to 1GB of RAM tomorrow with a new RAM chip. My swap partition is set to approximately double the RAM size. 1. Do I need to type some command after adding RAM to manually increase the size of the swap partition? 2. Will the swap partition automatically increase and I won't need to type a command manually? 3. Can I increase it without risk to whatever else is on the disk, if I have available space? 4. What size should it be? Should it be RAM x2 + 64MB, or is there a more preferrable setting? Thank you. |
| |||
| Google Mike wrote: > I have standard RH9 Linux with standard ext3 filesystem. > > I have 512 MB of RAM and plan to go to 1GB of RAM tomorrow with a new > RAM chip. My swap partition is set to approximately double the RAM > size. > > 1. Do I need to type some command after adding RAM to manually > increase the size of the swap partition? If yout want to increase your swap space, you have to add a partition or increase the size. parted is a tool, that can be pretty helpfull in this context. > > 2. Will the swap partition automatically increase and I won't need to > type a command manually? > Nope. > 3. Can I increase it without risk to whatever else is on the disk, if > I have available space? > Depends on your partitioning tool. But, I think changing paritions is always somewhat scary. > 4. What size should it be? Should it be RAM x2 + 64MB, or is there a > more preferrable setting? I think about twice the ram size is the defacto standard. But on the other hand, take top to take a look on the usage of swap. Mine is almost always hardly used. > > Thank you. With kind regards, Alex |
| |||
| Hello Google Mike (<googlemike@hotpop.com>) wrote: > I have standard RH9 Linux with standard ext3 filesystem. > > I have 512 MB of RAM and plan to go to 1GB of RAM tomorrow with a new > RAM chip. My swap partition is set to approximately double the RAM > size. > > 1. Do I need to type some command after adding RAM to manually > increase the size of the swap partition? The "double size of RAM" rule only applied to some early versions of the 2.4 kernel, as far as I know. If you don't use one of those kernels (and you probably don't), there is no need to increase the amount of swap space at all, if you only want to do it so it will be twice the amount of RAM you have. > 2. Will the swap partition automatically increase and I won't need to > type a command manually? The swap partition will remain the same size, unless you repartition manually. > 3. Can I increase it without risk to whatever else is on the disk, if > I have available space? Manipulating partitions never is without risk. If there is empty space behind the swap partition, and you only want to increase the swap partition's size, the risk is quite low. > 4. What size should it be? Should it be RAM x2 + 64MB, or is there a > more preferrable setting? As I already wrote, you probably don't need to change the swap size to 3GB (are swap partitions > 2 GB even supported?), unless the services you run require 4.5 GB of RAM and SWAP. If the machine worked reliably with 512 MB RAM and 1 GB swap, then it should also work with 1.5 GB of RAM and 1 GB of swap. best regards Andreas Janssen -- Andreas Janssen <andreas.janssen@bigfoot.com> PGP-Key-ID: 0xDC801674 ICQ #17079270 Registered Linux User #267976 http://www.andreas-janssen.de/debian-tipps.html |
| |||
| Google Mike <googlemike@hotpop.com> wrote: > I have standard RH9 Linux with standard ext3 filesystem. > > I have 512 MB of RAM and plan to go to 1GB of RAM tomorrow with a new > RAM chip. My swap partition is set to approximately double the RAM > size. > > 1. Do I need to type some command after adding RAM to manually > increase the size of the swap partition? Yep, if you want to. But why do you want to? Don't you have enough swap now? > 2. Will the swap partition automatically increase and I won't need to > type a command manually? No, your partitions will not magically change size underneath you, thank goodnes. > 3. Can I increase it without risk to whatever else is on the disk, if > I have available space? Only if you have space to increase it into. Why not add another swap partition instead? But why add anything at all? > 4. What size should it be? Whatever you need. How mmuch do you need? > Should it be RAM x2 + 64MB, or is there a > more preferrable setting? Yes - whatever you prefer. Peter |
| |||
| Google Mike (googlemike@hotpop.com) writes: > I have standard RH9 Linux with standard ext3 filesystem. > > I have 512 MB of RAM and plan to go to 1GB of RAM tomorrow with a new > RAM chip. My swap partition is set to approximately double the RAM > size. > You should have been watching how your swap gets used. If it barely gets used, then it won't need increasing with more ram. If is getting used significantly, the fact that you are doubling your RAM should help the situation. Swap is used to make good use of RAM. It keeps things that aren't being used at the moment handy, so you don't have to manually keep reloading things. If you've got a little bit of RAM, the swap partition will get a lot of use, because the operating system and the applications need more RAM space than you have. So the unused bits get swapped out when not being used, and swapped in when needed. If you've got enough RAM, as much as possible will be kept in RAM, since it's faster than using the hard disk. Hence, swap space will be less used as you increase your ram. Unless, of course, you are doing things that use up the available RAM pretty fast. Note that it is useage that really specifies the size of the swap partition, not some absolute value. I gather much of the "swap should be two times the RAM" dates from memory was relatively limited, so you would find that swap was needed often. But that was some time ago. I first installed Linux four years ago, in a very limited system, so limited that I didn't go very far with it. I went and bought a used Pentium with 32megs of RAM, and decided to make swap equal to three times the RAM. I did that because I anticipated getting more ram, and I had the hard disk space to spare. I went to 64megs, and then 96megs, and using free I rarely saw much use of the swap partition. Admittedly I am underusing the system, but it points out that swap plus RAM needs to be large only depending on what you are doing with the system. When I moved to this computer in January, I just made swap equal to RAM, because I know I don't use enough for swap to be used that much. If I'd had limited hard drive space, I might have considered less swap. Not only is much of my RAM free, but swap barely gets used. This might change if what I used the computer for changed. But it's fine right now, and unless you see excessive use of swap, then you shouldn't have to worry about increasing swap. Note that you can use swap files rather than partitions. Since I don't need them, I've not paid full attention to how to do it, but it is a solution if one comes upon something that suddenly requires more swap. If it's a temporary matter, then there's no sense fiddling with the swap partition. Michael > 1. Do I need to type some command after adding RAM to manually > increase the size of the swap partition? > > 2. Will the swap partition automatically increase and I won't need to > type a command manually? > > 3. Can I increase it without risk to whatever else is on the disk, if > I have available space? > > 4. What size should it be? Should it be RAM x2 + 64MB, or is there a > more preferrable setting? > > Thank you. |
| |||
| Google Mike wrote: > I have standard RH9 Linux with standard ext3 filesystem. > > I have 512 MB of RAM and plan to go to 1GB of RAM tomorrow with a new > RAM chip. My swap partition is set to approximately double the RAM > size. .... you wont need to follow this rule-of-thumb with 1gig RAM .. -- << http://michaeljtobler.homelinux.com/ >> If you wish to live wisely, ignore sayings -- including this one. |
| ||||
| On Tue, 2004-08-24 at 12:33 -0700, Google Mike wrote: > I have standard RH9 Linux with standard ext3 filesystem. > > I have 512 MB of RAM and plan to go to 1GB of RAM tomorrow with a new > RAM chip. My swap partition is set to approximately double the RAM > size. > > 1. Do I need to type some command after adding RAM to manually > increase the size of the swap partition? The swap partition will never, ever just change size automatically; you will always need to manually trigger any changes to it. > 2. Will the swap partition automatically increase and I won't need to > type a command manually? No, it will not increase, or decrease; see above. > 3. Can I increase it without risk to whatever else is on the disk, if > I have available space? That depends on exactly how your disk is laid out; if you're at all unsure, I'd say no. Otherwise, find a local guru and ask them to show you (not 'do it for you'). Changing the size of the swap partition generally involves pulling out a partitioning tool, backing up your entire disk, and repartitioning the drive; unless you really need to, I wouldn't bother. It sounds like you already have a swap partition that is easily big enough for anything you'd probably need to do. > 4. What size should it be? Should it be RAM x2 + 64MB, or is there a > more preferrable setting? The magic formula used to be 'RAMx2', but that's not really a good way of judging it. The real question you want to ask now is, "Do I need more than 2GB of memory?", because that's what you've got with 1GB RAM and 1GB swap. Remember, though, that accessing swap is many, many times slower than RAM. Chances are good you could probably reduce your swap partition and nothing would even notice, even now before you add the extra 512MB. Think of swap as 'emergency memory' which the system can use when it runs out of RAM so that it doesn't completely flake out. Assuming typical desktop use, an average Linux system, today, generally requires at least 256MB of total memory (that's both RAM and swap combined), with at least half of that being real RAM instead of swap; real RAM is always better than swap, when it can be afforded. With 512MB or more of RAM, you probably won't ever need more than 256MB of swap. However, this all depends on exactly what you do. If you run a lot of applications at once, or applications that consume a lot of RAM (eg: GIMP, editing a 4000x4000x32bit image), you'll want to set up a relatively large swap partition, to ensure that the system has plenty of combined memory for those times that it needs it. As a general rule, however, don't ever set up a swap partition that is more than double your available RAM; it's not that it will hurt anything, but it is pointless. If you have 1GB of RAM, and (therefore, following the swap=RAMx2 rule) set up a 2GB swap, you have a combined total of 3GB of memory. Before your system comes anywhere near consuming that 3GB, it's performance will have slowed to a crawl, as it spends most of its time paging memory in and out of the swap partition (remember, swap is hundreds, if not thousands of times slower than RAM). In fact, chances are good that by the time your hypothetical system has consumed a mere 1GB of its swap space, it will have slowed down to unusability, perhaps even acting like it has frozen. The general rule of thumb I'm seeing today is: set your swap partition to be equal to your RAM, assuming you have 512MB or more; also, don't ever bother making your swap partition larger than 1GB, especially if you have more than 1GB of RAM. And this is only if you're a hard-core power user who runs applications that consume memory like water. If not, a swap partition no larger than 512MB is probably more than sufficient. If you have less than 512MB, the old RAMx2 formula is probably good enough for most uses. Personally, I've got my swap set to 1GB, but that's because hard drive space is dirt cheap nowadays, so it doesn't really hurt. With 1GB of RAM, though, I've rarely seen it use more than 200Kb of my swap space. Ever. Even when I *was* editing those huge 4000x4000 images in the GIMP (to be fair, though, GIMP 2 does a pretty good job of paging itself out to disk without relying on the swap partition, so this may not be a good example). Remember though, real RAM is *always* better than swap, when you can afford it. Finally, I'd recommend using swap partitions over swap files, but that's just me. Swap files just strike me as being too easy to screw with, although that might just be my Windows bias seeping through. > > Thank you. |
| Thread Tools | |
| Display Modes | |
|
|