LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-04-2008, 12:07 AM   #1
diehell
LQ Newbie
 
Registered: Oct 2007
Posts: 2

Rep: Reputation: 0
Question Swap


hie there Guys,

Just curious, does setting the swap according to 2 * amount of RAM really apply?

what if i specify the amount of SWAP more than (2 * RAM) or less than (2 * RAM) have any effects.

Do the amount of RAM play any significant? such as if my RAM is 2G or 4G, do i need to set my SWAP using 2 * RAM?

If theres any links that discuss this, please feel free to share..

Thanks
 
Old 03-04-2008, 12:38 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
No - that's an anachronism.

The easiest rule of thumb is to accept whatever default the installer suggests.
 
Old 03-04-2008, 12:57 AM   #3
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: Debian Wheezy
Posts: 2,872

Rep: Reputation: 88
Quote:
Originally Posted by diehell View Post
Just curious, does setting the swap according to 2 * amount of RAM really apply?
I'll answer a question with a question.
How much swap do you need when 90% in use RAM goes into sleep mode?
 
Old 03-04-2008, 01:29 AM   #4
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
Use The pc as a stand alone follow the suggestion of the installer
Is it used by many users let it depend on the amount of users


all the best
 
Old 03-04-2008, 03:10 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
I think that the swap file needs to at least equal the amount of ram if it will be used for resuming from the sleep mode. But the 2*memory rule was just a guideline back when computers had 64MB of ram. Take a look at how much is actually used to get an idea. Probably around 3-10%, so if you use the sleep mode, 125% of ram might be a better rule. On the other hand, drives are a lot larger now and a 4 GB might not be missed.
 
Old 03-04-2008, 03:41 AM   #6
diehell
LQ Newbie
 
Registered: Oct 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jschiwal View Post
I think that the swap file needs to at least equal the amount of ram if it will be used for resuming from the sleep mode. But the 2*memory rule was just a guideline back when computers had 64MB of ram. Take a look at how much is actually used to get an idea. Probably around 3-10%, so if you use the sleep mode, 125% of ram might be a better rule. On the other hand, drives are a lot larger now and a 4 GB might not be missed.
Thanks jschiwal, appreciate your reply.
 
Old 03-04-2008, 10:05 PM   #7
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

It's worth emphasizing that most users on most contemporary systems could easily have *no* swap configured... and never even notice it!

As jschiwal said (and as I tried to say - but I guess not as clearly), the "2 * RAM" rule of thumb is completely a thing of the past - it's not relevant any more.

One final note, if you benchmark your actual usage and decide swap tuning will be of significant benefit to you, definitely consider tuning the (new in Linux 2.6) kernel parameter "swapiness".

Here are a couple of links:

http://www.linux.com/feature/121916
http://ask.slashdot.org/askslashdot/.../0032225.shtml
http://www.performancewiki.com/linux-tuning.html

'Hope that helps .. PSM

Last edited by paulsm4; 03-04-2008 at 10:07 PM.
 
Old 03-04-2008, 10:50 PM   #8
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
as has been stated the 2 * RAM is old info, but still holds true to an extent.


the rule i follow is this guideline, and that is ALL it is.

sub 512M ram use 2 * RAM
513-1024M use 1.5 * RAM
2G+ hard set swap between 512M - 1G depending on the applications you run and if your swap is even ever hit.

i tend to set mine at 512M (swap) as i run 2G ram.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
swap file instead of swap disk "dd" error rezwits Linux - Newbie 5 12-16-2007 01:34 AM
Need Help Increasing Swap by creating a swap file froggo Red Hat 3 06-13-2006 09:04 AM
Linux swap / solaris not appearing as swap in Ubuntu? Erik_the_Red Linux - Newbie 1 07-30-2005 01:57 PM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 02:23 AM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 08:58 PM


All times are GMT -5. The time now is 10:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration