[OpenIndiana-discuss] Swap during install

Richard Elling richard.elling at richardelling.com
Tue Sep 25 20:00:47 UTC 2012

On Sep 25, 2012, at 11:41 AM, Peter Tribble <peter.tribble at gmail.com> wrote:

> On Tue, Sep 25, 2012 at 1:50 PM, Richard Elling
> <richard.elling at richardelling.com> wrote:
>> Use what you need. Most people don't need or want to use swap. Why? Because...
>> if you have to swap, performance will suck. Period. Case closed. Game, set, match.
>> HDDs are 5 orders of magnitude slower than RAM and all the king's horses and all
>> the king's men can't fix that.
>> The old rule of "2x" RAM has not been true since around the time you could put 1GB of
>> RAM into a machine. Interestingly, the place we normally see vehement arguments for
>> 2x RAM is from Oracle DBAs who believe everything ever written in an Oracle manual :-)
>> hint: run "swap -l" and see if free == blocks. If so, then you've never used
>> swap since the system was booted.
> That's not true. Anonymous reservations go against swap, if it's available.

Technically, you are correct...

> Not having adequate swap can kill performance, because you end up forcing
> reservations to be made against real memory rather than swap. And I would
> much rather have idle garbage sat out in swap rather than have it block
> valuable RAM. In both cases inadequate swap depletes the availability of
> real memory, and you want as much of that free as possible.

... in which case swap will have been used. So the test still stands as empirically
useful :-)

For the curious, pmap -x will show the summary of anonymous memory
mapping for a process. For the whole system, as root:
	echo ::memstat | mdb -k

Measure it, and use what you need.

> I run general-purpose workloads, and find 2x RAM to be a good starting
> point. I've got systems with 32G RAM with 32G swap in use (half really in
> use, half just reserved). They aren't swapping, at all, performance isn't
> impacted, whereas if I didn't have the swap some applications wouldn't
> even run.
> So it varies; with disk relatively cheap I would rather be generous than
> parsimonious.

32GB is 2 DIMMs today. It is quite easy to build a machine with 256GB for
some more dollars, 1TB for a modest pile of dollars, at which point 2x RAM for
swap becomes silly once again.
 -- richard

illumos Day & ZFS Day, Oct 1-2, 2012 San Fransisco 
Richard.Elling at RichardElling.com

More information about the OpenIndiana-discuss mailing list