The mysterious kern.maxswzone

Andrea Venturoli ml at netfence.it
Tue Jan 22 07:47:05 UTC 2019


On 1/21/19 9:44 PM, Kevin P. Neal wrote:

> With the difference in performance between a CPU and disk, does relying
> on swap space make sense anymore?

I think it still does.
Of course performance will be terrible, but it can be acceptable for 
short periods of time: e.g. I've got a box which will swap considerably 
when periodic is run, but that happens at night and no one will notice.

Also, I prefer an occasional slow down to processes being occasionally 
killed.

If the machine constantly and heavily swapping, it's time for either a 
software diet or hardware upgrade.



> The x1 and x2 rules of thumb come from a different era.

One thing to keep in mind are crash dumps: they are written in a swap 
partition, so, if you don't have enough and your box panics, you won't 
be able to debug it.
I've been hit in the past by this: a box's swap was be taylored to RAM 
size, the RAM was doubled and crash dump could not be obtained anymore.

I also heard something about "minidumps", or compressed dumps, but did 
not investigate... so yes, all this *might* be obsolete; however, with 
modern HD sizes (1TB at the least) I prefer to "waste" some more space 
for swap, than to be sorry later.

That's also why I don't bother about kern.maxswzone: I have some swap 
space I don't need *now*; it's just sitting there for eventual future 
needs :)



> Oh, and won't swapping to a GEOM mirror cause deadlocks? I thought so, but
> I wouldn't take my word for it.

I have several boxes with swap on GMIRRORs and I've never seen any 
deadlock due to this fact.
Just my experience... perhaps there are corner cases?


  bye
	av.


More information about the freebsd-questions mailing list