The old rule where swap had to at least equal RAM in order to get a proper core dump of main memory no longer is true. You need sufficient space in /var/crash, but that's it. Swap size is irrelevant to obtaining panic crash dumps anymore.

And, as pointed out elsewhere, if your swap is being used for anything other than pre-allocation reserve memory, your performance is down a cliff.

Swap allocation is entirely dependent on your application usage; if you have applications that consistently pre-reserve memory before using it, then swap is a fine place to have the memory manager "allocate" that page without eating into actually usable DRAM. You should configure enough swap to handle the amounts of preallocation you expect. That's it. It's not even a good choice to use swap for very-seldom-used memory pages anymore - with the design of the VFS layer and things like L2ARC, you can get information back from "disk" faster then you can from swap.

Your machine should always have enough DRAM in it to handle its normal workload - swap these days is only for that special case above; it's far better to start hitting the EOM error than to start using swap for actual work. The performance cliff is pretty much the same (i.e. having lots of swap does NOT provide a graceful performance decline, as it's now approaching 6 orders of magnitude difference in speed).

If you find yourself doing a non-trivial amount of swapping, then you need to do one of two things:

(1) buy more DRAM
(2) redesign the applications to use smaller working sets that will fit in the amount of RAM you consider reasonable.

If you can't do either, then the system is not the right one to use for the applications you have (i.e. the wrong hardware is being used).

-Erik


On 4/20/2013 9:42 AM, Richard Elling wrote:
On Apr 19, 2013, at 10:37 PM, Andrew Evdokimov <[email protected]> wrote:

Hi Richard,

On 20.04.2013 2:39, Richard Elling wrote:
you need a 32G swap device on any drive you like just to satisfy swap
allocation requirements coming from applications.
Not likely. Measure it before using generalizations.
...
So this box needs 187 MB of swap to back the anonymous pages.
right, this box needs 187 MB of swap _today_. It may happen that you'll need 
188 (or 186 or 2186 or 3187) MB tomorrow because of natural changes in 
workload, so why to spend time measuring and configuring and checking and 
re-checking your swap requirements on a regular basis while 32GB of swap costs 
only $1.6 with 3TB SATA HDDs? I really think there are many much more 
fascinating and economically sound areas in OS performance tuning than precise 
swap sizing. Just let it be equal to your RAM size and forget about it forever.
Big machines today have 32TB of RAM, much more than $1.6 worth of slow HDD.
The important takeaway is that the old rules to thumb (eg 2x RAM) do not apply
today and are not needed if you properly measure and design your system.

  -- richard



-------------------------------------------
illumos-discuss
Archives: https://www.listbox.com/member/archive/182180/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182180/21319143-b7837b05
Modify Your Subscription: https://www.listbox.com/member/?&;
Powered by Listbox: http://www.listbox.com



-------------------------------------------
illumos-discuss
Archives: https://www.listbox.com/member/archive/182180/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182180/21175430-2e6923be
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=21175430&id_secret=21175430-6a77cda4
Powered by Listbox: http://www.listbox.com

Reply via email to