jb jb.1234abcd at gmail.com
Mon May 27 09:57:16 UTC 2013

M. V. <bored_to_death85 <at> yahoo.com> writes:

> ... 
> > Swapping by itself can decrease system reliability due to possible
> > data corruption on swap disk or during two-way transfers, with 
> > subsequent incorrect RAM and machine crash.
> >
> > But, swapping is also a symptom, not a problem.
> > It is never a good idea to let it get to that point.
> ...
> >
> Very interesting point.
> - do you think this could hurt my server's stability too? (most of its
work is a noticeable amount of
> packet-forwarding, and other network services, like firewall, dhcp server,
ntp server, etc)
> - if so, in what conditions? can I do something to prevent this? or should
I just get rid of the swap partition?
> - does swap partition do any good for me at all? I mean if we even suppose
nothing bad happens because of it, is
> it worth risking to keep it? 
> thank you.

I wish there was a clear answer.

There are two schools practised by server owners:
- with swap space (partition or file)
  They see swapping as a symptom (of a problem, real or potential), and they 
  treat it as a useful early warning device that gives them time to act.
  If prolonged or unattended, swapping may slow down the system and even end
up   in "thrashing", which is close to a terminal state.
- no swap space
  They are "purists" - when they set up a server for a specific purpose they   
  know it (requirements, apps run, resources assigned) and they are in charge.
  No "sissy" swapping, they do not trust those kernel algos, etc. 
  They know that out-of-memory kernel killer may terminate a process (perhaps 
  not the one they would expect) in case of memory crunch, but they think they 
  can live with it by closely watching system and app state indicators to
  prevent that from happening.

In the end it comes down to owner's preferences. 
If in doubt, try with and without swap space and see how it works in your
particular environment.


More information about the freebsd-questions mailing list