Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The swap question that won't go away

Status
Not open for further replies.

reinstalled

IS-IT--Management
Feb 18, 2003
178
Hi guy's

I've read a few older posts about "rule of thumb" for setting swap size -vs- memory and need just a little clarification.

I have a new V240 with 4GB memory. Now I know that the 2x rule of thumb doesn't have to apply. This server will run a Sybase DB that will be hit constantly. So would the recommended sixe be 2x, 3x, etc.....

Thanks
 
I'm in the "less is more" camp on this one. I've noticed that the more swap you have, the more Solaris seems to want to swap things out. I can have 8GB in the machine and only about 2GB worth of processes and it will still swap like half of it out. I would LOVE to be able to make a process unswappable (if anyone knows, please post).

The 2x and up rules of thumb were created when a machine with 256 or 512 Megabytes of memory was considered big. Now when a machine commonly has 2 GB to 8 GB to even more on some systems (I have one with 12 GB), the 2x rule isn't needed and makes no sense.

You do have to size it for the app and load that will be running on the machine. That is, real+swap needs to be able to hold everything plus breathing room. I wonder, if I have 12 GB and that's actually 4x of what I would really need, can I do without swap? Just run everything in real memory? Does Solaris need swap? Or is it just a cheap way to get a larger memory space?

I wonder.

Well, that's my 2 cents.
 
To answer SamBones question... Does Solaris really need swap? The answer is Yes... Not only is swap used by the OS to hold unused processes in memory, swap is also used for core dumps when the system crashes. Saying that, your swap size should be at least equal to the amount of memory you have in your system. I agree with SamBones stating if you have 8 GB of ram, do you really need a 16 GB Swap (following the 2x rule). I really don't think so. The Database Admins here should have more insite as to what is needed to run a database...
 
Solaris does not need swap space, I have seen many installations without swap on disk. By default Solaris sets the dumpdevice to swap assuming it is large enough to write all RAM to it. If you don't have swap you can easily change it using dumpadm utility.

On machines with extended RAM the old days rule of thumb does not make sense; I agree, RAM + swap should be big enough to hold everything plus some breathing room... Since Solaris can swap to files there is no problem to extend swap on demand.

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years in the domain of the OS, Backup and Storage
 
While DaFranze is correct (Solaris will run without swap) it's always good to have some swap space configured so that the system can page if it needs to. Remember paging and swapping are not the same. These days allocating 4Gb disc space for swap isn't a significant portion of your total disc space (it was when we were using 9Gb discs!).

reinstalled says the server in question will be a Sybase DB with significant use. I'd configure 4Gb swap space and keep an eye on performance. When the box starts paging it'll be a good idea to add more memory because paging is a big performance hit but at least the box won't die. You can always add more swap space using swap -a but I'd suggest that if you've got to the point where you're hitting a dual-processor box so hard it's using all 4Gb swap space for paging then it'll be running so slow you'll have to take your phone off the hook :)
 
You can have TOO MUCH though, which will negatively impact performance.
 
The rules for Solaris are as follows;

If total memory in server is less than 2GB, then 2x swap,

If more than 4GB RAM then 4GB of swap or less is good.

This is straight from the SUN Admin Guides.
 
these are good rule of thumbs, but it's not an article (law);
when I worked as a programmer we changed swap to 20x RAM because the compiler needed so much space to link the executable...

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years in the domain of the OS, Backup and Storage
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top