How big of Swap file do you need?
I have a LSI Raid card with three 160 gb drives doing raid 5. The default swap is 1 gb do I need to up this default setting? What is the swap file used for? thanks bob
On 6/8/05, BOB HERZOG <herzogb@swdubois.k12.in.us> wrote:
I have a LSI Raid card with three 160 gb drives doing raid 5. The default swap is 1 gb do I need to up this default setting? What is the swap file used for?
How much RAM do you have? As a rule swap should be 2x you amount of RAM. Swap is in effect a scratchpad for the filing system (similar to pagefile.sys) and holds information being swapped between the memory and the filesystem, Regards, Ben
On Wednesday 08 June 2005 11:20, BOB HERZOG wrote:
I have a LSI Raid card with three 160 gb drives doing raid 5. The default swap is 1 gb do I need to up this default setting? What is the swap file used for?
thanks bob
The usual recomendation is 2x RAM. Sunny
Bob, Traditionally your swap file should be at least twice the size of the RAM in the machine. Swap is, as it implies a easily addressable memory location where data is swapped in and out. I'm not sure if this is correct, but I always picture it as buffer space for things being pulled in and out of RAM. Cheers Todd BOB HERZOG wrote:
I have a LSI Raid card with three 160 gb drives doing raid 5. The default swap is 1 gb do I need to up this default setting? What is the swap file used for?
thanks bob
-- Systems Administrator ---------------------------------- Soho VFX - Visual Effects Studio 99 Atlantic Avenue, Suite 303 Toronto, Ontario, M6K 3J8 (416) 516-7863 http://www.sohovfx.com ----------------------------------
On Wed, 2005-06-08 at 11:20 -0500, BOB HERZOG wrote:
I have a LSI Raid card with three 160 gb drives doing raid 5. The default swap is 1 gb do I need to up this default setting? What is the swap file used for?
thanks bob
The size depends on a number of factors such as what is running on the machine, how much physical ram is installed, etc. For normal everyday desktop use this should be enough. swap is used as an extension to installed ram and is used to store programs that are not currently running is ram when ram is in short supply (many programs running at the same time), sorta. There is more to it than that but I wanted to try and keep an answer simple. 10-20 years ago ram was $40 or more per megabyte and swap was a cheaper alternative to buying more ram. -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 "The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners." -Ernst Jan Plugge
Ken Schneider wrote:
On Wed, 2005-06-08 at 11:20 -0500, BOB HERZOG wrote:
I have a LSI Raid card with three 160 gb drives doing raid 5. The default swap is 1 gb do I need to up this default setting? What is the swap file used for?
thanks bob
The size depends on a number of factors such as what is running on the machine, how much physical ram is installed, etc. For normal everyday desktop use this should be enough. swap is used as an extension to installed ram and is used to store programs that are not currently running is ram when ram is in short supply (many programs running at the same time), sorta. There is more to it than that but I wanted to try and keep an answer simple. 10-20 years ago ram was $40 or more per megabyte and swap was a cheaper alternative to buying more ram.
Now, You need swap like you need MEMORY. If you are going to run a program and hte program needs in peak 1 GB in RAM and you have 128 Mb en physical RAM. You need 900 Mb in SWAP 900 + 128 =~ 1 Gb For the program, you have 1 Gb. The problem is that the 90% is a slow RAM, very very slow! But is for the program RAM. You will use in SWAP all that you need in memory space! Now, is not correct 2x RAM or 1x RAM. NOT Is all the memory that you need! -- ------------------------------------------------------ Una prensa libre es el gran enemigo de los dictadores. Independientemente de sus abusos, sus debilidades, sus errores. Una prensa libre es la gran aliada y defensora de la democracia. Charlos S. Shapiro Embajador de USA en la Rep. de Venezuela Martes, 20 de Mayo 2003
On 2005-06-08 18:20 +0200, BOB HERZOG wrote:
I have a LSI Raid card with three 160 gb drives doing raid 5. The default swap is 1 gb do I need to up this default setting? What is the swap file used for?
As little / as much as you need. Consider what apps you run, how much memory they use, and add a reasonable swap, so that you never run out of memory. If your ram is big, you might not need any, but it will not hurt. In any case, processes that are not running can be swapped out and the freed memory can be used for better uses, like disk buffers. The rule of "twice the ram" has no sense in Linux (windows had that limit time ago). It can be anything from a fraction of the ram, to dozens of times the ram. By the way, setting swap partitions in different drives with the same priority makes swapping faster. Setting it up in a raid partition will be slower but more reliable. Your choice ;-) -- Cheers, Carlos Robinson
On Wed, Jun 08, 2005 at 11:20:53AM -0500, BOB HERZOG wrote:
I have a LSI Raid card with three 160 gb drives doing raid 5. The default swap is 1 gb do I need to up this default setting? What is the swap file used for?
MHO... It depends on how much RAM you've got, and how much virtual memory you need (i.e. how much total RAM + swap you think you'll need to run all your processes). I would suggest somewhere between 0.5 x RAM and 1.5 x RAM. If you have too little, then the kernel will be forced to use physical RAM for stuff which is used very infrequently and would therefore be a waste, as it could be being used as disk cache. If you are regularly using as much swap as you have RAM, you should be buying more RAM, not increasing your swap (unless you are severely budget-constrained, or your processes are such that they are happy to be swapped out most of the time). The 2 x RAM rule-of-thumb is less relevant nowadays. BTW, some people here have mentioned to me that there is a problem with Linux' performance with large amounts of swap (in particular, >2 GB). We have some Opterons with 16 GB RAM, but I'm told that Linux won't support individual swapfiles > 2 GB, and that if you add lots of 2 GB swapfiles, the performance drops off massively. Has anyone seen this? We're using RHEL, but I guess the problem would be seen on SuSE as well. -- David Smith Work Email: Dave.Smith@st.com STMicroelectronics Home Email: David.Smith@ds-electronics.co.uk Bristol, England GPG Key: 0xF13192F2
On Thursday 09 June 2005 5:59 am, David SMITH wrote:
On Wed, Jun 08, 2005 at 11:20:53AM -0500, BOB HERZOG wrote:
I have a LSI Raid card with three 160 gb drives doing raid 5. The default swap is 1 gb do I need to up this default setting? What is the swap file used for?
MHO...
I would suggest somewhere between 0.5 x RAM and 1.5 x RAM. If you have too little, then the kernel will be forced to use physical RAM for stuff which is used very infrequently and would therefore be a waste, as it could be being used as disk cache.
David Smith
Another thought to swap space size is if you Suspend-To-Disk you need a swap file at least as large as your RAM plus a wee bit so you don't run out of swap space when the machine Suspends-To-Disk. Stan
participants (9)
-
Ben Higginbottom
-
BOB HERZOG
-
Carlos E. R.
-
David SMITH
-
Hipolito A. Gonzalez M.
-
Ken Schneider
-
M. Todd Smith
-
Stan Glasoe
-
Sunny