LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 09-25-2007, 11:39 AM   #1
daWabbit
LQ Newbie
 
Registered: Jun 2003
Location: Fort Worth, Texas
Distribution: Debian 3.0 (Woody) SuSE 9.1 and Tiny
Posts: 10

Rep: Reputation: 0
Swap space size on multi-core systems


So far, on single core/single cpu systems, I have had good luck with making much smaller swap files than the partitioner on Ubuntu or other such systems wants to. On this machine, with a 1.0 GHz Pentium 3 and 512 MB RAM, I have never used more than 180 MB of swap. My partition is 450 MB, so I'm well covered, there.

But I am building a new system. It will have 4 cpu cores (dual sockets) System memory will be 4 GB, to start. (I can go up to 8, but I don't have the money for that.) The workload will be about the same as what I do on this machine. How much swap would you folks recommend? I'm wondering if the presence of more cores means I might use more swap.

Thanks;
Jack Imsdahl
 
Old 09-25-2007, 01:30 PM   #2
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
swap usage is dictated by the need for your system to have memory in excess of the physical memory available on the system. If you are not experiencing much need for swap using a single processor system, you won't experience much need for swap in a multiprocessor system presuming you have at least the same amount of RAM available and your workload is the same.
 
Old 09-25-2007, 02:57 PM   #3
Rustylinux
Member
 
Registered: Mar 2006
Posts: 177

Rep: Reputation: 30
Typically the rule of thumb is the swap file should be 1.5 times the amount of memory you have in your machine. however i belive it caps at 2GB. Seeing as you didn't use the swap file much in your last system with only 512mb of memory having 4GB of memory in the new system i can't see the need for a massive swap file. However its a force of habit for me to follow the rule of thumb just incase i EVER will need
 
Old 09-25-2007, 05:29 PM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,631

Rep: Reputation: 519Reputation: 519Reputation: 519Reputation: 519Reputation: 519Reputation: 519
Quote:
Originally Posted by Rustylinux View Post
Typically the rule of thumb is the swap file should be 1.5 times the amount of memory you have in your machine.
1997 called and wants their rule back. This is a bad rule to follow, and has been for a few years.
Quote:
however i belive it caps at 2GB.
What, swap space? Swap space can be as big as you want it to be.
Quote:
Seeing as you didn't use the swap file much in your last system with only 512mb of memory having 4GB of memory in the new system i can't see the need for a massive swap file.
This is true.

TC, if you are going to be hibernating, then with 4GB of RAM you want like a 3GB swap (the image is compressed some). Otherwise, I can't see you ever dipping into swap unless you do video editing.

Cores have no relation to swap size, only RAM does.

On a 4GB non-video-editing, non-hibernating system, I'd go with like a 128MB swap, and be surprised if it needs to be used.
 
Old 09-25-2007, 06:57 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,229

Rep: Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019
Quote:
Originally Posted by AlucardZero View Post
What, swap space? Swap space can be as big as you want it to be.
This is architecture dependant. Last I looked on x86 (32-bit) 2 Gig (per extent) was the limit mkswap would deal with. Redhat put out a hack to relieve this limit, don't know if it has made it's way into the mainstream.
Quote:
Cores have no relation to swap size, only RAM does.
Oh, I don't know - 4 tasks concurrently looping on malloc gotta burn more swap than just one ...

Forgot to mention - I'm just building a similar system. FWIW, I threw a Gig of swap at it.

Last edited by syg00; 09-25-2007 at 07:00 PM.
 
Old 09-25-2007, 07:05 PM   #6
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 57
You probably don't need any or a very small amount of swap space, there has been people you have 1 gb of ram who don't make a swap file or parition
 
Old 09-26-2007, 06:32 PM   #7
daWabbit
LQ Newbie
 
Registered: Jun 2003
Location: Fort Worth, Texas
Distribution: Debian 3.0 (Woody) SuSE 9.1 and Tiny
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks a lot, folks

I made my decision. I went ahead and put in something of a swap file, but not much in relation to RAM, etc. I put in 750 MB swap. I just finished the install (Ubuntu Dapper; I stick with the long term support releases on my production boxes) and so far the max swap usage has shown to be 36 MB. Not much, is it?

The system is running fine now. Thanks again for the reasoned responses.
 
Old 09-26-2007, 07:13 PM   #8
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 57
Quote:
Originally Posted by daWabbit View Post
I made my decision. I went ahead and put in something of a swap file, but not much in relation to RAM, etc. I put in 750 MB swap. I just finished the install (Ubuntu Dapper; I stick with the long term support releases on my production boxes) and so far the max swap usage has shown to be 36 MB. Not much, is it?

The system is running fine now. Thanks again for the reasoned responses.
750 mb of swap is alot, I have less then that on my system with 256 mb of ram. In my opnion, you should have made like a hundred mb of swap or so
 
Old 09-26-2007, 07:21 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,229

Rep: Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019
Disk is cheap - and swap is cheap insurance.
 
  


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
how much swap space is needed; how to increase swap space? johnpaulodonnell Linux - Newbie 5 03-23-2007 03:20 AM
Why should you give the size of the swap disk as twice the size of RAM vmniza Linux - Newbie 3 09-17-2004 02:13 AM
Good swap space for Fedora Core 2? blueturtle Linux - Newbie 4 08-10-2004 10:18 AM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 01:23 AM
displaying swap space size with df durden2.0 Linux - Newbie 2 07-14-2003 01:07 AM


All times are GMT -5. The time now is 10:02 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration