From owner-freebsd-questions@freebsd.org Fri Sep 18 03:21:41 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 CA5709CD1C3 for ; Fri, 18 Sep 2015 03:21:41 +0000 (UTC) (envelope-from Olivier.Nicole@cs.ait.ac.th) Received: from mail.cs.ait.ac.th (mail.cs.ait.ac.th [192.41.170.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33096198C for ; Fri, 18 Sep 2015 03:21:41 +0000 (UTC) (envelope-from Olivier.Nicole@cs.ait.ac.th) Received: from mail.cs.ait.ac.th (localhost [127.0.0.1]) by mail.cs.ait.ac.th (Postfix) with ESMTP id 34C69D7883; Fri, 18 Sep 2015 10:21:37 +0700 (ICT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cs.ait.ac.th; h= content-type:content-type:mime-version:message-id:date:date :in-reply-to:subject:subject:from:from:received:received :received; s=selector1; t=1442546496; x=1444360897; bh=MovkC+qK4 vDX0vUztUx9CA1jC+9BCHS0jWc4duIO29Q=; b=i2/Yk0nehRK163N4SXGQ+oHOB SKcR/zCmskKDcLqWe6vwpJHqBW0N9wLbibYmezQ2gY5vVwq6JB/kpuO3u4ErW+oB ITLjX0NpkOhJQChbrSkYsTDK7JKQnZvKBrYMvMV8STnXETzy38Dg1tqxjjXu5o6D Wll0ANUcIcUGQ8mq6s= X-Virus-Scanned: amavisd-new at cs.ait.ac.th Received: from mail.cs.ait.ac.th ([127.0.0.1]) by mail.cs.ait.ac.th (mail.cs.ait.ac.th [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 7f4yUZWy4VSg; Fri, 18 Sep 2015 10:21:36 +0700 (ICT) Received: from banyan.cs.ait.ac.th (banyan.cs.ait.ac.th [192.41.170.5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.ait.ac.th (Postfix) with ESMTPS id 3BFC5D7881; Fri, 18 Sep 2015 10:21:36 +0700 (ICT) Received: (from on@localhost) by banyan.cs.ait.ac.th (8.14.7/8.14.7/Submit) id t8I3LZ3N012070; Fri, 18 Sep 2015 10:21:35 +0700 (ICT) (envelope-from on@banyan.cs.ait.ac.th) From: Olivier Nicole To: Bernard Higonnet Cc: freebsd-questions@freebsd.org Subject: Re: Constantly running out of swap space In-Reply-To: <55FAFEE4.5080701@higonnet.net> (message from Bernard Higonnet on Thu, 17 Sep 2015 19:56:52 +0200) Date: Fri, 18 Sep 2015 10:21:34 +0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain 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: Fri, 18 Sep 2015 03:21:42 -0000 Bernard Higonnet writes: > 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 am running amavisd/clamd on a machine, I gave it 4GB RAM and it still swap from time to time. Amavis, one master, two children, each are almost 500MB clamd, almost 500MB See: last pid: 70640; load averages: 0.16, 0.16, 0.17 up 8+16:01:29 10:19:16 89 processes: 1 running, 88 sleeping CPU: 0.0% user, 0.0% nice, 1.5% system, 0.0% interrupt, 98.5% idle Mem: 838M Active, 2148M Inact, 640M Wired, 68M Cache, 409M Buf, 248M Free Swap: 8192M Total, 119M Used, 8073M Free, 1% Inuse PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 68717 kluser 1 35 0 469M 298M lockf 2 0:46 0.00% perl 68444 kluser 1 20 0 469M 297M select 0 0:52 0.00% perl 759 kluser 2 20 0 443M 319M select 0 12:12 0.00% clamd 64665 kluser 1 20 0 435M 269M select 3 0:34 0.00% perl 643 root 1 20 0 270M 1112K select 0 0:03 0.00% rpc.statd 70386 root 1 20 0 249M 239M select 0 0:14 0.00% avs 953 root 1 20 0 247M 238M select 0 80:33 0.00% avs 662 root 1 20 0 105M 4444K select 1 6:57 0.00% vmtoolsd 741 postgrey 1 20 0 103M 9884K select 1 1:00 0.00% perl 70471 on 1 25 0 99900K 8324K select 2 0:00 0.00% sshd 70468 root 1 22 0 99900K 8256K select 3 0:00 0.00% sshd The 3 first perl processes are amavis. In your case, you could try to configure asmavis to not spawn any child (is it even possible), for 100 mails per day, it is plenty enough. But even that and clamd, you are already above 1GB. By the way, you write 768KB of RAM, do you mean 768MB? Bests, Olivier > I assume amavisd/clamd are not using swap space explicitly and the OS > decides on is own that swap space is needed. > > Any suggestions? > > TIA > Bernard Higonnet > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > --