From owner-freebsd-questions@FreeBSD.ORG Sun May 26 23:33:07 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4129999E for ; Sun, 26 May 2013 23:33:07 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 01C2224F for ; Sun, 26 May 2013 23:33:06 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.7/8.14.7) with ESMTP id r4QNWvVS029581; Sun, 26 May 2013 17:32:57 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.7/8.14.7/Submit) with ESMTP id r4QNWu3i029578; Sun, 26 May 2013 17:32:57 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Sun, 26 May 2013 17:32:56 -0600 (MDT) From: Warren Block To: Polytropon Subject: Re: "swap" partition leads to instability? In-Reply-To: <20130526113235.f5dbe768.freebsd@edvax.de> Message-ID: References: <1369558712.96152.YahooMailNeo@web165006.mail.bf1.yahoo.com> <20130526160906.4e379016@X220.ovitrap.com> <20130526113235.f5dbe768.freebsd@edvax.de> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Sun, 26 May 2013 17:32:57 -0600 (MDT) Cc: Erich Dollansky , "freebsd-questions@freebsd.org" , "M. V." X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 23:33:07 -0000 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." 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: http://www.wonkity.com/~wblock/docs/html/ssd.html And here is the PR with a patch: http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/168544