Does swap increase freebsd performance?
steve at sohara.org
Tue May 5 09:59:16 UTC 2020
On Tue, 05 May 2020 15:39:16 +0600
Nikita Stepanov <nikitastepanov113 at yandex.kz> wrote:
We seem to be getting a rash of bodyless messages with the question
in the subject. Please type a body with your question even if it is a
repeat of the subject.
Swap can increase performance by making more of the memory
available for active use. Many programs have memory allocated that is very
rarely used or even only used at startup, pushing this out to swap frees
physical memory for more active use such as caching.
Whether this makes a difference to performance or not depends
greatly on the workload, or more importantly the memory pressure the
If there is plenty of memory then swap won't help and there is
overhead involved in writing pages out to swap so it will reduce
performance very slightly.
If there is just about enough memory then swap will make it more
useful and increase performance. This 'sweet spot' is in reality often quite
wide depending on the benefits of caching on workload and so forth.
If there is insufficient memory then swap will keep things working
but performance will suffer badly. This can be very important in the face
of an unusual load spike.
Steve O'Hara-Smith <steve at sohara.org>
More information about the freebsd-questions