From owner-freebsd-isp Fri Oct 12 13:10:10 2001 Delivered-To: freebsd-isp@freebsd.org Received: from mail.tgd.net (rand.tgd.net [64.81.67.117]) by hub.freebsd.org (Postfix) with SMTP id 9398137B409 for ; Fri, 12 Oct 2001 13:10:03 -0700 (PDT) Received: (qmail 98284 invoked by uid 1001); 12 Oct 2001 20:09:59 -0000 Date: Fri, 12 Oct 2001 13:09:59 -0700 From: Sean Chittenden To: Marcel Prisi Cc: freebsd-isp@FreeBSD.ORG Subject: Re: PostgreSQL & shared memory Message-ID: <20011012130959.C97952@rand.tgd.net> References: <006001c1516b$db2637b0$8d01a8c0@gastroleader.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <006001c1516b$db2637b0$8d01a8c0@gastroleader.com>; from "marcel-lists@virtua.ch" on Wed, Oct 10, 2001 at = 11:13:41AM X-PGP-Key: 0x1EDDFAAD X-PGP-Fingerprint: C665 A17F 9A56 286C 5CFB 1DEA 9F4F 5CEF 1EDD FAAD X-Web-Homepage: http://sean.chittenden.org/ Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > We just published a new website running on FreeBSD 4.4 prerelease 10 august > / apache 1.3.20 / php 4.0.6 / PostgreSQL 7.1.2 . > > In fact we moved the site from a Win2k/iis/sqlserver to BSD, and we have a > HUGE amount of hits, and the machine is already getting overloaded. > PostgreSQL seems like a ressource hog. The machine is a bi-PIII 866Mhz, > 380Mb RAM, Adaptec 2100s. > > I had to stop using both keepalive in apache and persistent connections in > php in order to keep the machine from swapping and not responding anymore. > The load is extremely high as some SQL queries are really hard ... > > The first thing we'll do is install some more memory, and then a separate > machine for PostgreSQL. Whew, I was going to bing you with a clue bat if you didn't suggest getting more RAM: 380MB of RAM isn't much. All this aside, what you want to do is setup a reverse proxy server. You have these HUGE Apache and postgresql processes sitting around in RAM spending most of their time doing what? Writing their data out over the wire. The best thing you can do to speed up your webapp is to increase your kernel output buffers and/or use a reverse proxy (mod_backhand, mod_proxy, or even squid). Would you like to have a large 12-20MB process sending data out over the wire, or a small 400KB process that's mostly shared memory? -sc -- Sean Chittenden To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message