VectorLinux
October 25, 2014, 12:20:36 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: Lessons in swap space  (Read 2535 times)
brokndodge
Member
*
Posts: 83


Linux is sooo HOT


WWW
« on: September 12, 2010, 04:58:22 pm »

After nearly 18 years of administering various Linux systems, one would think that I know something about setting up a swap partition.  So the rule is 3 times your physical memory.  Why oh why did I think 20x would be a good idea? 

Just finished setting up the last HP Vectra I had on the shelf.  I've given away 35 out of the 36 I was given.  Each one of them with a fresh copy of VL on them.  Starting with VL 5.8 Gold.  Each time I broke out a calculator and figured 3 x physical memory when setting up the swap partition.  This time I only had 128 MB of pc100 memory left.  So I came to the conclusion that 2048 MB swap would be a good idea.  Seems funny now.

After three days of fighting with a system that took 12 minutes to load google.com, took 8 minutes just to log out of tty2, I finally figured out the problem was this huge swap partition I had created.

Turned swap off with
Code:
swapoff -a
that helped a lot.  I was then able to slapt-get --install gparted.  With gparted now up and running I just did a quick and dirty resize of the swap space down to 384 MB.  That was a lil painful in that gparted really needs more than 128 MB to run on x.  But I sat thru it till the changes were committed.  Didn't even bother to shut down gparted before I switched to tty2 and turned swap back on with
Code:
swapon -a

Several minutes went by while memory management straightened itself out.  The system gradually started to respond again.  Then bam, right back up to normal speed!  That was a painful lesson in swap space.  Don't think I will ever be doing that again. 

HP Vectra specs:
P3 @ 450MHz
128 MB physical PC100 RAM
384 MB swap (was 2048 MB)
60GB EIDE Hard disk
VectorLinux 6.0 Gold Standard w/ Google Chrome
Logged

VL 7.0 Standard

brokndodge
- OSS is not a religion, it's the solution to buggy irresponsible coding -
Linux User# 494720
stretchedthin
Administrator
Vectorian
*****
Posts: 3780


WWW
« Reply #1 on: September 12, 2010, 05:41:06 pm »

Hey, good to see you back brokndodge.  I rarely go beyond 2x physical memory, but never new the consiquences of going beyond. Thanks for the heads up.
Logged

Vectorlinux screencasts and  tutorials can be found at....
http://www.opensourcebistro.com/blog1
http://www.youtube.com/user/vid4ken?feature=mhee
brokndodge
Member
*
Posts: 83


Linux is sooo HOT


WWW
« Reply #2 on: September 12, 2010, 06:09:50 pm »

thx for the wb stretchedthin.  with more physical memory available, 2x is enough.  this one is critically low so 3x is needed, but can't do more than that.  seems the problem is that the memory manager uses physical memory to map the swap space, i didn't have enough physical ram to map that much swap.
Logged

VL 7.0 Standard

brokndodge
- OSS is not a religion, it's the solution to buggy irresponsible coding -
Linux User# 494720
GrannyGeek
Packager
Vectorian
****
Posts: 2567


« Reply #3 on: September 12, 2010, 08:58:23 pm »

After nearly 18 years of administering various Linux systems, one would think that I know something about setting up a swap partition.  So the rule is 3 times your physical memory.

Whoa! I wouldn't call "3x your physical memory" a rule. I've *never* made a swap partition that large in 10 years of using Linux. I do have about a gig of swap on my lowest-RAM computer (512 megs); on my 1gig of RAM computers I have 512 megs of swap, and the same on my 3 gigs of RAM computer.

I don't object to the size of the swap partition you finally settled on, but I do challenge the "rule" designation, which I think might mislead users.
--GrannyGeek
Logged

Registered Linux User #397786

Happily running VL 7 Gold on  a Sempron LE-1300 desktop (2.3 GHz), 4 G RAM,  GeForce 6150 SE onboard graphics and on an HP Pavilion dv7 i7, 6 gigs, Intel 2nd Generation Integrated Graphics Controller
tomh38
Vectorian
****
Posts: 913



« Reply #4 on: September 13, 2010, 02:59:37 am »

I usually make a 2x RAM swap partition ... I don't see that 3x would hurt, but if you have enough actual RAM, you can do without swap completely.  What I don't understand is why it's bad to have too big a swap partition.  brokndodge, are you saying that if you make a huge swap partition, then since physical RAM is used to map it, it takes that much more RAM to map if the partition is bigger?
Logged

"I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones." - Linus Torvalds, April 1991
retired1af
Packager
Vectorian
****
Posts: 1265



« Reply #5 on: September 13, 2010, 03:43:33 am »

If the system uses the swap space too often, one could see a large drop in system responsiveness.

Found this: http://www.linux.com/news/software/applications/8208-all-about-linux-swap-space

Makes some compelling arguments for having a LARGER swap space, contrary to what many seem to think should be the norm. Especially with the newer kernel and its abilities to handle swap files more efficiently.
Logged

ASUS K73 Intel i3 Dual Core 2.3GHz
GrannyGeek
Packager
Vectorian
****
Posts: 2567


« Reply #6 on: September 13, 2010, 12:05:57 pm »

Makes some compelling arguments for having a LARGER swap space, contrary to what many seem to think should be the norm. Especially with the newer kernel and its abilities to handle swap files more efficiently.

I didn't see any compelling arguments, just some info about what swapping does and why more space than you think you need might be a good idea. The thing is, if you have any amount of swap space set up and it's NEVER, EVER used (as is the case on my systems), what's the point of having more? I think some swap space is a good idea precisely because the system is set up to use it in the way described in the article, but that assumes the system *needs* to swap something out or would benefit by swapping something out. If you check frequently and find that no matter what you do, your swap usage is 0, I don't think you benefit by having lots of swap space.

There is one thing that requires swap space depending on how your system is set up. If you have a system crash, information can go into a memory dump that is stored in the swap space. This can then be analyzed to see what might be going wrong. The space has to be large enough to contain everything that's in your memory, so if you have 6 gigs of RAM you'd need at least 6 gigs of swap space. However, since ordinary mortals can't figure out what such a file is telling you, for a regular user there is no benefit. So a system can be set up to NOT save such a memory dump. In that case, the swap space is not needed for that. I'm almost 100% sure that VectorLinux does not do a memory dump in case of a system crash. Do remember that I don't understand any of this and am just repeating what I've heard.
--GrannyGeek
Logged

Registered Linux User #397786

Happily running VL 7 Gold on  a Sempron LE-1300 desktop (2.3 GHz), 4 G RAM,  GeForce 6150 SE onboard graphics and on an HP Pavilion dv7 i7, 6 gigs, Intel 2nd Generation Integrated Graphics Controller
retired1af
Packager
Vectorian
****
Posts: 1265



« Reply #7 on: September 13, 2010, 12:25:39 pm »

For a newer system, one could make the argument that a swap partition was not needed, especially for those systems with large amounts of RAM. And for the majority of users, this indeed could work for them as most users don't really use their PC to its full capacity. However, there are some of us that tend to wring out every ounce of power from their systems with some applications and games which would necessitate a hefty swap file. On the notebook, I've always allocated at least 1GB of swap space, and there's been a couple of times where I wished I had given a lot more. Going to reinstall VL7 later this week and redo the SWAP partition, giving it around 8GB of space. I'll modify how often it's accessed and then see if I can squeeze just a wee bit more out of this poor ol' notebook.

Logged

ASUS K73 Intel i3 Dual Core 2.3GHz
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!