From owner-freebsd-questions@FreeBSD.ORG Thu Jan 17 20:53:38 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 935AE16A418 for ; Thu, 17 Jan 2008 20:53:38 +0000 (UTC) (envelope-from wmoran@potentialtech.com) Received: from mail.potentialtech.com (internet.potentialtech.com [66.167.251.6]) by mx1.freebsd.org (Postfix) with ESMTP id 84EAF13C4EC for ; Thu, 17 Jan 2008 20:53:38 +0000 (UTC) (envelope-from wmoran@potentialtech.com) Received: from vanquish.pitbpa0.priv.collaborativefusion.com (pr40.pitbpa0.pub.collaborativefusion.com [206.210.89.202]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.potentialtech.com (Postfix) with ESMTP id 36596EBC3B; Thu, 17 Jan 2008 15:53:37 -0500 (EST) Date: Thu, 17 Jan 2008 15:53:36 -0500 From: Bill Moran To: robert@webtent.com Message-Id: <20080117155336.0c38d86d.wmoran@potentialtech.com> In-Reply-To: <1200602606.7281.48.camel@columbus.webtent.org> References: <1200602606.7281.48.camel@columbus.webtent.org> X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Robert Fitzpatrick , FreeBSD Subject: Re: db performance X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jan 2008 20:53:38 -0000 In response to Robert Fitzpatrick : > We have several postfix transport gateways on different networks all > working with local amavisd-maia+SA using a remote postgresql backend at > one location. I am getting delays in the queues on a gateway server at a > remote site since we added more memory to the db server. After seeing > the issues of "SA TIMED OUT" in the logs, seems this was happening prior > to the upgrade, but never to the extent, I guess, to delay much mail. > Queues on a gateway of the same network as the db server working fine, > but messages with the timeouts differ from one server to another. > > After reading tuning, it suggests the SWAP should be double RAM. > According to dmesg... > > real memory = 3220635648 (3071 MB) > avail memory = 3150565376 (3004 MB) > > we have 3GB of RAM available with actually 4GB physical RAM installed? > Anyway, the SWAP is only 2GB, even with the average usage shown here, > will increasing SWAP to 6-8GB help? > > last pid: 49828; load averages: 0.23, 0.21, 0.18 up 8+18:33:08 15:42:23 > 184 processes: 5 running, 158 sleeping, 21 waiting > CPU states: 2.6% user, 0.0% nice, 1.0% system, 0.0% interrupt, 96.4% idle > Mem: 446M Active, 1646M Inact, 236M Wired, 138M Cache, 112M Buf, 30M Free > Swap: 2048M Total, 164K Used, 2048M Free Adding swap is unlikely to help you, as you're not really using much memory. > I also have assumed in the past that db performance could be better if I > get off the system RAID-5 and put it on 1+0? The system has 4 SATA > drives. That will speed things up if IO is your bottleneck, but you've not demonstrated that. Which machine in this system is the bottleneck? Are the Amavis machines timing out, or is the PostgreSQL server too slow? If I understand your description, it sounds like a network problem to me ... i.e., machines not on the same gateway as the PG server are experience slow network response (or dropped packets?) that's causing amavis to time out while trying to talk to PG. I would suggest investigating there first. -- Bill Moran http://www.potentialtech.com