LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-17-2009, 12:28 AM   #1
shaikjaveed1
LQ Newbie
 
Registered: Mar 2009
Posts: 2

Rep: Reputation: 0
Exclamation Swap size for a server with 128 GB RAM





Hi friends

I have a server running RHEL AS 4.7 which is being used for high end visualization applications. It has 128 GB of RAM but the swap space currently set on this server is 30GB.


free -g
total used free shared buffers cached
Mem: 125 60 65 0 0 35
-/+ buffers/cache: 25 100
Swap: 30 0 30


Can anybody tell how much swap space can be set on this server? Should I set it to 256GB !!! going by the thumb rule or should it be equal to size of memory?

The users who have tested their applications on this server say that it takes the same time to process as it would on dell 690 workstation which has 8GB RAM in it.

FYI this server has 2 NVIDIA GRAPHIC CARDS

->% more /proc/driver/nvidia/cards/0
Model: Quadro FX 5600
IRQ: 217
Video BIOS: 60.80.1e.00.05
Card Type: PCI-E
DMA Size: 40 bits
DMA Mask: 0xffffffffff
Bus Location: 05.00.0
->% more /proc/driver/nvidia/cards/1
Model: Quadro FX 5600
IRQ: 217
Video BIOS: 60.80.1e.00.05
Card Type: PCI-E
DMA Size: 40 bits
DMA Mask: 0xffffffffff
Bus Location: 90.00.0


While the 690 Dell workstation has 1 NVIDIA GRAPHIC CARD

Model: Quadro FX 4500
IRQ: 169
Video BIOS: 05.70.02.41.03
Card Type: PCI-E
DMA Size: 39 bits
DMA Mask: 0x7fffffffff
Bus Location: 07.00.0




Any suggestions as to how the server performance can be improved?
 
Old 03-17-2009, 12:37 AM   #2
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Considering your application (high end visualization) I wouldn't think that any swap usage would be tolerable. So, I'd say even less than what you have.
 
Old 03-17-2009, 12:40 AM   #3
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
With this size of ram you should rarely need swap. Usually swap is twice the size of ram but if you have 128gb of ram then you might not need swap. It should depend on how heavy usage will be and what applications are going to run. My desktop machine does not even have the amount of hard drive as big as your ram.
 
Old 03-17-2009, 01:24 AM   #4
Nibbl3r
LQ Newbie
 
Registered: Dec 2008
Location: Zuerich, Switzerland
Distribution: Fedora Core/Debian
Posts: 28

Rep: Reputation: 16
Usually in the sizes of 16 GB + Ram you consider the SWAP disc as big as your OS.

If you use RHEL i would consider it about 5GB.
Everything else doesnt make sense.

Remember Swap discs are just for unused programms which reside in memory which can be swaped out for performance/space issues.

Your Application will use the Libraries in Shared memory anyways so the only data which resides in the memory is the user specific app data. Which will be (hopefully) destroyed on disconnect.

As you can apply the rule of thumb here. ( and i dont know your whole setup/environment/influences)

I would recommend you to have a look overall if you use this system activly log the ram usage and the swap usage.

Maybe even copy a filelist down from the swap disc. Maybe do this over 1 week or 2 (depending if you have a full workload of people on the server) and figure out by yourself how much is really needed.

Recommendation from me is 5 GB Swap. +- your adjustment.
I would monitor it anyway after making changes on this setting. For example you dont want to have a full memory after while your apps stop to swap out and stay in your ram.
 
Old 03-17-2009, 02:55 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
If you'd used code tags for that output, you'd have noticed that its saying,
SWAP: total 30 used 0 free 30
IOW, its not swapping ....

on my box (RHEL 5.3)
Code:
             total       used       free     shared    buffers     cached
Mem:       3708928    2044472    1664456          0     133096    1015516
-/+ buffers/cache:     895860    2813068
Swap:      6094840          0    6094840
If you run top, you'll see it more like
Code:
Swap:  6094840k total,        0k used,  6094840k free,  1015516k cached
 
Old 03-17-2009, 05:22 AM   #6
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
[QUOTE=shaikjaveed1;3477882]


Code:
 free -g
             total       used       free     shared    buffers     cached
Mem:           125         60         65          0          0         35
-/+ buffers/cache:         25        100
Swap:           30          0         30
If this is normal operation with a representative workload, normal operation should never cause any swapping.


Quote:
Should I set it to 256GB !!!
No
Quote:
going by the thumb rule or should it be equal to size of memory?
No

Quote:
Usually in the sizes of 16 GB + Ram you consider the SWAP disc as big as your OS.
If you use RHEL i would consider it about 5GB.
What you want, in addition to having enough memory for normal operations, which it seems that you have, is, when something goes wrong, for the system to slow down gracefully rather than to crash. 2G would do this as would 5 or 10, but I cannot see what having more than that would accomplish. I guess, given your spec, that you have enough disk space...

Quote:
The users who have tested their applications on this server say that it takes the same time to process as it would on dell 690 workstation which has 8GB RAM in it.
Which is a bit disappointing, but then it doesn't seem that you are anywhere needing the amount of ram that you have installed.

Quote:
Any suggestions as to how the server performance can be improved?
Right now, no. The algorithm is to find the bottlenecks and cure them and I am afraid that nothing about this post gives me any idea what the bottlenecks are (apart from that its not the amount of memory, if the memory usage data above is recorded in a reasonably heavy working scenario).
 
Old 03-17-2009, 05:29 AM   #7
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73
Try to set in /etc/sysctl.conf this:

vm.swappiness = 0
(tell the kernel to use only RAM memory, only in critical situations to use swap, this should help a lot)

Add the line and then run: sysctl -p

Good luck!
 
Old 03-17-2009, 10:41 AM   #8
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Until you place a much heavier load on the system than shown in that free output, the amount of swap space won't matter at all.

Quote:
Originally Posted by shaikjaveed1 View Post
Should I set it to 256GB !!! going by the thumb rule or should it be equal to size of memory?
The "rule of thumb" for swap space is usually nonsense and in this case extreme nonsense.

Assuming you plan to put a much heavier load on this system's memory, you may want to think through what the swap space would be for in order to estimate how much you want.

1) Stale pages in background tasks. Swap space lets the system kick those out in favor of more file caching (but so far you're not doing enough file I/O for the system to even want more file caching). When memory is almost full including file caching (if it ever gets there) you could look at the total of the RES sizes of several background tasks selected by lowest accumulated CPU time in long sleeping tasks. That would give a very crude estimate of how much swap you might want for this reason. Most likely it will be a very small number.

2) Your "high end visualization applications" might be very excessive in their mapping of COW and Demand-Zero memory areas, causing issues with the limits on memory commit level, such that correct operation requires allocating a big swap area that the system would never actually use, but whose existence keeps the kernel from thinking it has over committed memory. It is an unlikely situation but possible. Look for absurdly high values in the VIRT column in top to see how possible it might be.

Quote:
The users who have tested their applications on this server say that it takes the same time to process as it would on dell 690 workstation which has 8GB RAM in it.
You seem to be using a lot more than 8GB. But I guess the important task is cpu bound and uses less than 8GB.
 
Old 03-17-2009, 11:54 AM   #9
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
The rule of thumb was true back when computers had 16MB of RAM. Those days are long gone.

Code:
 free -g
             total       used       free     shared    buffers     cached
Mem:           125         60         65          0          0         35
-/+ buffers/cache:         25        100
Swap:           30          0         30
That's 60GB used, 25 for applications and 35 for buffers and cache. Then 65GB completely unused. Then 30GB swap space, but 0GB of it used. You do not have to worry about swap space, and you should not increase its size.
 
Old 03-17-2009, 02:28 PM   #10
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by shaikjaveed1
I have a server running RHEL AS 4.7 which is being used for high end visualization applications. It has 128 GB of RAM but the swap space currently set on this server is 30GB.
...
Can anybody tell how much swap space can be set on this server? Should I set it to 256GB !!! going by the thumb rule or should it be equal to size of memory?
Read here for one perspective: http://www.linux.com/feature/121916

It doesn't speak precisely to your situation, but it is useful nonetheless.

IMO, you've sized your swap space just about right. With 128GB RAM I probably also would have set up a swap space between 24 and 32GB (nothing especially scientific there, BTW). What you want to do is build yourself a comfortable buffer in case your server does begin to use swap space. This will help you avoid a system crash.
 
  


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 size for a 16Gb RAM database/application server Reginald0 Linux - Server 2 04-30-2008 01:56 PM
Swap double size of the RAM zillah Fedora 3 12-24-2005 07:13 AM
Swap double size of the RAM zillah Solaris / OpenSolaris 3 11-22-2005 11:30 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:39 AM.

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