LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
LinkBack Search this Thread
Old 07-11-2006, 10:17 PM   #1
nancy_iles
LQ Newbie
 
Registered: Jul 2006
Posts: 2

Rep: Reputation: 0
swap file best practice


I have a server with 16GB ram with RH Enterprise AS 4 update 3 installed. I wanted to create swap files totaling 2 x memory so I created four 8 GB swap files on 4 drives. However, most documentation seems to say that a swap file should not be larger than 2GB. I found an article on RHN (Article ID: 7794) that says the documentation is wrong and larger swap files are permitted. It does not say whether or not RH will use the swap properly when over 2 GB. What is the best practice?

TIA,

Nancy
 
Old 07-11-2006, 10:42 PM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,538

Rep: Reputation: 58
have you monitored your server's performance and memory usage? does the memory exceed 100% (or even come remotely close to that)? if it is often near 100% or more then you definetly need some swap space (i could never comprehend a need for 32GB (!) swap space, above your 16GB physical memory).

i think the amount of swap space you need is dependant on the load of the system. also, remember that swap space is just hard disk space used to 'fake' RAM and is _extremely_ slower and may actually slow down your system.

my thoughts..
 
Old 07-11-2006, 10:42 PM   #3
rshaw
Senior Member
 
Registered: Apr 2001
Location: Perry, Iowa
Distribution: Mepis , Debian
Posts: 2,694

Rep: Reputation: 45
the best practice is to not use the swap space at all.(the hard drive is much slower than ram.) the 2x ram thing is a holdover from long ago when ram was expensive and not much of it would fit on the main board.

there is no hard and fast rule but you could consider:

max memory requirements(worst case) - physical ram size = swap size
 
Old 07-12-2006, 03:52 AM   #4
syg00
Guru
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 9,976

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
The old "swap == 2 x RAM" is probably irrelevant in most cases these days. And you certainly wouldn't want to be swapping large chunks.

For i86 architetures, the generic limit is 2 Gig per swap extent - up to a total of 32 extents.
I believe RH introduced a source update at ES3 (and later) to remove the 2 Gig limit.

All your allocated space will be used if you did the mkswap at that release.
 
Old 07-13-2006, 09:56 AM   #5
nancy_iles
LQ Newbie
 
Registered: Jul 2006
Posts: 2

Original Poster
Rep: Reputation: 0
I finally called Red Hat support and ended up talking to one of their performance people. The documentation is incorrect. Swap files larger than 2 GB are allowed IF the Red Hat driver is installed instead of a 3rd party driver. You can check whether or not the system sees all the swap with the command 'free'. In the end, I have 2 8GB swap files so it equals the amount of memory. The swap files are on two different drives. The other thing is that fstab should not specify a priority for the swap files.

Thanks for all the input.

Nancy
 
Old 07-13-2006, 12:19 PM   #6
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,538

Rep: Reputation: 58
be aware its possible you could be wasting 16gb.
 
Old 07-13-2006, 05:39 PM   #7
syg00
Guru
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 9,976

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Swap space is insurance - 16 Gig of disk space costs peanuts.
If a system is anything but a single user "toy", scrimping on swapspace is ridiculous.
 
Old 07-13-2006, 08:15 PM   #8
fp88
LQ Newbie
 
Registered: Jul 2006
Location: Chicago
Posts: 2

Rep: Reputation: 0
I wouldn’t recommend creating swap space over or under 2 GB. If you require more physical memory purchase it. The system won’t use it if configured and tuned properly and if it does excessively providing you’re running a database you’re bound to crash or the poor performance may send you looking elsewhere for employment. I’m the lead responsible for the Linux support at our organization and backup DBA. We use RHEL#AS for database servers on Linux. In regards to decent sized databases at our organization residing on Linux one is approximately 600 GB residing in Informix IDS 10.UC4 and the other 350 GB residing in Oracle 9.0.6. Oracle is currently running on 32-bit RHEL3AS and will remain that was until migrating to 10G early next year then it will reside on 64-bit RHEL4AS. Informix was just migrated within the last 30 days to RHEL4AS 64-bit. Neither database has ever used swap on 32 or 64 bit RHEL.
 
  


Reply

Tags
swap


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help Increasing Swap by creating a swap file froggo Red Hat 3 06-13-2006 09:04 AM
Why have a swap file when.... ? krkda Linux - General 8 04-15-2006 11:19 AM
Best practice size for Swap partition Garp Linux - General 7 01-18-2006 06:32 AM
File partitions - best practice? kentarwen Fedora - Installation 3 01-05-2005 07:22 PM
Swap File Cyric Slackware 13 10-05-2004 12:19 AM


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