LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-07-2006, 04:20 AM   #1
simonj82
LQ Newbie
 
Registered: Jun 2006
Location: Roma, Italy
Distribution: Slackware, Slamd64
Posts: 3

Rep: Reputation: 0
Swap size...


Hi everybody,
i'm installing Slamd64 on my SunFire V40z server (2 AMD Opteron 64bit with 4GB RAM and 72GB RAID1 hard drive configuration).
I will use it only in console mode (no X server) and it'll run MySQL server, Apache and Courier-IMAP, but... i don't know which is the right swap size choice...
Some people say to make two 2GB swap partition, other say to use more less...
Because i don't want to waste my precious hard disk space, how big this partition(s) should be??
Thanx a lot in advance!
Nice greetings!

Simone.
 
Old 06-07-2006, 04:27 AM   #2
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
double the RAM is the convention i believe.
 
Old 06-07-2006, 05:15 AM   #3
davidsrsb
Member
 
Registered: Oct 2003
Location: Kuala Lumpur, Malaysia
Distribution: Slackware 13.37 current
Posts: 770

Rep: Reputation: 33
The x2 rule of thumb is not applicable to machines like yours. With that much ram I would have a small swap, say 512MB.
 
Old 06-07-2006, 05:26 AM   #4
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
Quote:
Originally Posted by prozac
double the RAM is the convention i believe.
Quote:
Originally Posted by davidsrsb
The x2 rule of thumb is not applicable to machines like yours. With that much ram I would have a small swap, say 512MB.
i think he's right! i have 768M RAM in my workstation. and this is my free -m
Quote:
------ total used free shared buffers cached
Mem: 748 737 10 0 15 451
-/+ buffers/cache: 270 477
Swap: 1027 39 987
most of the swap is going unused. waste of space. double the RAM is just a convention from old times when people used to had too less memory. we still need swap but the x2 convention just wastes space in actual high memory systems.

Last edited by prozac; 06-07-2006 at 05:27 AM.
 
Old 06-07-2006, 08:15 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Quote:
Originally Posted by simonj82
Hi everybody,
i'm installing Slamd64 on my SunFire V40z server (2 AMD Opteron 64bit with 4GB RAM and 72GB RAID1 hard drive configuration).
I will use it only in console mode (no X server) and it'll run MySQL server, Apache and Courier-IMAP, but... i don't know which is the right swap size choice...
Some people say to make two 2GB swap partition, other say to use more less...
Because i don't want to waste my precious hard disk space, how big this partition(s) should be??
Thanx a lot in advance!
Nice greetings!

Simone.
Hi,

With the RAM that you have for this machine, the swap size could be in the 512MB range. Your swap will see little to no activity.

My question is why you feel the hard disk space is so precious? Heck, the byte cost is low for HD space now days. You say you use RAID1. What are the HD specifications? Is it a 10K drive?
 
Old 06-07-2006, 08:27 AM   #6
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, CentOS, RHEL, OpenBSD
Posts: 1,006

Rep: Reputation: 37
Check this document about maxin' that swap performance http://www.gentoo.org/doc/en/article...m-swappage.xml
 
Old 06-07-2006, 09:45 AM   #7
davidsrsb
Member
 
Registered: Oct 2003
Location: Kuala Lumpur, Malaysia
Distribution: Slackware 13.37 current
Posts: 770

Rep: Reputation: 33
As that gentoo link is mentioning kernel 2.2.x and 128MB swap, it was written when ram was in the 64MB range and real systems were ram limited.
 
Old 06-07-2006, 01:35 PM   #8
dennisk
Member
 
Registered: May 2004
Location: Southwestern USA
Distribution: CentOS
Posts: 279

Rep: Reputation: 30
While I doubt it applies in this case, if you are planning to use the swap partition to hibernate the computer you'll want to have a partition that can hold all the data in RAM plus what's in video ram. So, as others have noted, don't be stingy with swap space.

dennisk
 
Old 06-07-2006, 02:06 PM   #9
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
On the other end of the scale, keep in mind that the minimum swap size is only 4K and you'll have to press a machine really hard to ever make one freeze up running with no swap at all. I've only been able to do this by compiling mozilla suite with all tests and debugging on a 350MHz iMac with less than 200MB RAM. i realize you are running a server yo you'll want to have some around, but no need to get carried away unless your needs are special or heavy.
 
Old 06-07-2006, 05:22 PM   #10
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
I would recommend 1GB of swap. You won't be using a significant amount of disk space and if you use more than 512MB of it, which will happen only after going through the 4GB of RAM, you will have 512MB in reserve.

What do you anticipate the load of this server to be? Apache and MySQL can consume huge amounts of resources if given enough work to do and data to play with.

Peace...
 
Old 06-09-2006, 04:04 AM   #11
ludist
Member
 
Registered: Nov 2005
Location: Greece
Distribution: Slackware
Posts: 172

Rep: Reputation: 21
Swap is an emergency, slow solution, of out-of-memory situation.

In your position, I would like the "risky path": no swap. 4G of RAM is huge, unless your servers are serving thousands of people simultanouesly. But I can't understand, how big a server can be :-) It will mainly "transfer files" right? So, the memory (4G) will be a great cache. You need also to use swap as cache? I don't think so.

Check how much memory your servers need with free. I don't run mySQL server (yet) and mail server, but my system is happy with 256MB RAM and 100MB swap (25used) apache + php + ssh + several deamons + iceWM + 32MB of ramdisks.

Conservative approach: add 512MB of swap and then disabled if you find with free that is not used.
 
Old 06-09-2006, 09:44 AM   #12
marsm
Member
 
Registered: Aug 2005
Distribution: Ubuntu
Posts: 62

Rep: Reputation: 15
Surely there must be a log file which generates statistics of the general usage of your Linux system. Unfortunately, I have no idea what its name might be. Somebody drop us a hint, please

Regarding swap space specifically, TLDP seems to have some good advice.
 
  


Reply



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 partition size alaios Linux - General 4 09-27-2004 01:21 PM
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
swap size kodiakmook Linux - Software 6 01-05-2002 12:52 AM
Swap Size ajtaus Linux - General 3 12-19-2001 01:19 PM
Right size swap? jamaso Linux - Newbie 7 11-12-2001 12:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:59 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
Open Source Consulting | Domain Registration