From owner-freebsd-performance@FreeBSD.ORG Wed Dec 1 10:51:13 2004 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD27116A4CE for ; Wed, 1 Dec 2004 10:51:13 +0000 (GMT) Received: from web14102.mail.yahoo.com (web14102.mail.yahoo.com [216.136.172.132]) by mx1.FreeBSD.org (Postfix) with SMTP id 848CC43D66 for ; Wed, 1 Dec 2004 10:51:13 +0000 (GMT) (envelope-from cguttesen@yahoo.dk) Received: (qmail 79350 invoked by uid 60001); 1 Dec 2004 10:51:13 -0000 Message-ID: <20041201105113.79348.qmail@web14102.mail.yahoo.com> Received: from [194.248.174.58] by web14102.mail.yahoo.com via HTTP; Wed, 01 Dec 2004 11:51:13 CET Date: Wed, 1 Dec 2004 11:51:13 +0100 (CET) From: Claus Guttesen To: freebsd-performance@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: postgresql on FreeBSD 5.3 and high load X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2004 10:51:13 -0000 Hi. Our postgresql-server hits the wall when we get many hits on our web. The load-average reaches 70. It serves 11 webservers. The server is a Dell PE 2850 with 4 GB RAM, dual Nocona at 3.2 GHz, HTT is not enabled. It's running FreeBSD 5.3 stable (amd64-port). Postgresql ver. 7.4.5 from ports. The SCSI-controller is LSILogic MegaRAID with six disks and three stripes which is mirrored (RAID 0+1). Only hardware RAID. Due to problems with 4 GB RAM I added hw.physmem=4G to /boot/loader.conf, which for some reason reduced available memory to 3211 MB. Since then it has run stable. I have this custom-kernel: options SHMMAXPGS=262144 options SEMMNI=160 options SEMMNS=960 options SEMUME=160 options SEMMNU=480 options PMAP_SHPGPERPROC=1280 postgresql.conf: max_connections = 768 shared_buffers = 65536 sort_mem = 4096 vacuum_mem = 65536 checkpoint_segments = 4 commit_delay = 100000 commit_siblings = 250 effective_cache_size = 32768 Fsync is *not* enabled. I have increased shared_buffers and commit_siblings gradually, but it does not seem to lower the load on the server. /etc/sysctl.conf: kern.ipc.somaxconn=2048 kern.maxfiles=65536 net.isr.enable=1 ipcs -M: shminfo: shmmax: 1073741824 (max shared memory segment size) shmmin: 1 (min shared memory segment size) shmmni: 192 (max number of shared memory identifiers) shmseg: 128 (max shared memory segments per process) shmall: 262144 (max amount of shared memory in pages) Eventhough load average is high, it's not always 0 % idle, but between 0 and 2 percent. netstat -m 18446744073709545011 mbufs in use 4519/25600 mbuf clusters in use (current/max) 0/0/0 sfbufs in use (current/peak/max) 7386 KBytes allocated to network 0 requests for sfbufs denied 0 requests for sfbufs delayed 0 requests for I/O initiated by sendfile 20286 calls to protocol drain routines I can't find the bottleneck. regards Claus