"swap" partition leads to instability?

Warren Block wblock at wonkity.com
Sun May 26 23:33:07 UTC 2013

On Sun, 26 May 2013, Polytropon wrote:

> On Sun, 26 May 2013 16:09:06 +0700, Erich Dollansky wrote:
>> Hi,
>> On Sun, 26 May 2013 01:58:32 -0700 (PDT)
>> "M. V." <bored_to_death85 at yahoo.com> wrote:
>>> I have a 24/7 network server/gateway with FreeBSD-8.2 on a SSD drive.
>>> it's partitioned as normal (/ , /tmp, /var , /usr and swap) for a
>>> long time now. But recently I heard from a FreeBSD expert that I
>>> shouldn't have swap partition for my server, and having swap
>>> partition could make my server unstable. this was so strange for me,
>>> and I searched a lot but couldn't find a reason for this claim.
>> because it is a false claim. I never ever have had any system with
>> working hard, that gave a problem because of the swap space.
> I think the "problem" here is that he's using a SSD.
> As soon as the swap partition is being in heavy use,
> which means it receives many writes, this may lead
> to the SSD "wearing out", decreasing its lifetime.

Another problem with SSDs is that they can have difficulty with wear 
leveling.  This is even worse with swap because there is no way to use 
TRIM to tell the SSD about blocks that have been freed.

The workaround is a swapfile on UFS with TRIM enabled.  It works fine, 
and even better when you update the rc scripts for shutdown.

Here's an article on setup:

And here is the PR with a patch:

More information about the freebsd-questions mailing list