From owner-freebsd-questions@freebsd.org Thu Sep 17 18:16:04 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 030739CEB97 for ; Thu, 17 Sep 2015 18:16:04 +0000 (UTC) (envelope-from amvandemore@gmail.com) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7E731132 for ; Thu, 17 Sep 2015 18:16:03 +0000 (UTC) (envelope-from amvandemore@gmail.com) Received: by wicge5 with SMTP id ge5so2126950wic.0 for ; Thu, 17 Sep 2015 11:16:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=N+jAj6G4Bl4bv9Ar7gdF1oz5az3eoX3jMhQrbQuOeWM=; b=GVzpqdcJ5iAoPCKpe5zyYts2O/agxSLIcfR8q79IFtQweyI9fDAvAK0utu5skv3m65 ez6QISk+fX6gV1WVOnCFslH+f1Z9ry7fF/vcAbsd/EosaARJKh7sH8vYkZG27vceokr7 H+ycKGpK2DvYFFZtRlPhDIJHgQzWAD4hJKRwEDOAk1vBA/yI4umnUyb0rdG9Q+AGNVCs WD4+/q7k0XlBtSlFsAkJlLCKOB8J4HUxYVJdQte72Xk7B0C39a1E/O/coNVgvXzMOc6Q PdFnSAJQ3GqWqhP7UOpBnDCNLWA7779Fw0lbxJW5GfXZfaasZnM0rtFgr0yyi4qXTU8s LX3Q== MIME-Version: 1.0 X-Received: by 10.180.101.198 with SMTP id fi6mr10538195wib.25.1442513761977; Thu, 17 Sep 2015 11:16:01 -0700 (PDT) Received: by 10.194.16.231 with HTTP; Thu, 17 Sep 2015 11:16:01 -0700 (PDT) In-Reply-To: <55FAFEE4.5080701@higonnet.net> References: <55FAFEE4.5080701@higonnet.net> Date: Thu, 17 Sep 2015 13:16:01 -0500 Message-ID: Subject: Re: Constantly running out of swap space From: Adam Vande More To: Bernard Higonnet Cc: FreeBSD Questions Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2015 18:16:04 -0000 On Thu, Sep 17, 2015 at 12:56 PM, Bernard Higonnet wrote: > Using FreeBSD 10.2 > > I'm using a swap file set up as described at > https://www.freebsd.org/doc/handbook/adding-swap-space.html > > No matter what size I make it (last time 4GB) I run out of swap space on a > VPS with 768KB RAM. Space is being used by amavisd/clamd which is > apparently notorious space hungry, but it's clear to me there's a problem > somewhere. Everything works OK for a while (a few hours? on a system with > very little traffic (100 emails a day...)) and then runs out of space. > > I assume amavisd/clamd are not using swap space explicitly and the OS > decides on is own that swap space is needed > Only the kernel controls VM, not userland. Userland tools can only make requests. > Any suggestions? > If it was me, I'd remove any file backed swap you may have already added and then configure whatever is using swap to consume less. In your case, amavisd/clamd have settings which will do so. I would also eliminate any unnecessary services on the box. Your VPS provider may also be able to provide you with a separate block device which can be used as dedicated swap although I would avoid doing that under most circumstances. -- Adam