Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 861289FB4DA for ; Tue, 15 May 2007 07:49:13 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 51034-10 for ; Tue, 15 May 2007 07:49:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 41E249FB4C5 for ; Tue, 15 May 2007 07:49:10 -0300 (ADT) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id DBADC74EED; Tue, 15 May 2007 11:47:29 +0100 (BST) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id BE08A27411C; Tue, 15 May 2007 11:47:29 +0100 (BST) Message-ID: <46498FC1.6060202@archonet.com> Date: Tue, 15 May 2007 11:47:29 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: Tarhon-Onu Victor Cc: pgsql-performance@postgresql.org Subject: Re: 500 requests per second References: <464825DE.3090007@archonet.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/263 X-Sequence-Number: 24653 Tarhon-Onu Victor wrote: > On Mon, 14 May 2007, Richard Huxton wrote: > >> 1. Is this one client making 500 requests, or 500 clients making one >> request per second? > > Up to 250 clients will make up to 500 requests per second. Well, PG is pretty good at handling multiple clients. But if I'm understanding you here, you're talking about potentially 250*500=125000 updates per second. If each update writes 1KB to disk, that's 125MB/sec continuously written. Are these figures roughly correct? >> 2. Do you expect the indexes at least to fit in RAM? > > not entirely... or not all of them. Hmm - OK. So you're going to have index reads accessing disk as well. Exactly how big are you looking at here? Will it be constantly growing? Can you partition the large table(s) by date or similar? Well, the two things I'd expect to slow you down are: 1. Contention updating index blocks 2. Disk I/O as you balance updates and selects. Since you're constantly updating, you'll want to have WAL on a separate set of disks from the rest of your database, battery-backed cache on your raid controller etc. Check the mailing list archives for recent discussions about good/bad controllers. You'll also want to substantially increase checkpoint limits, of course. If you can cope with the fact that there's a delay, you might want to look at replication (e.g. slony) to have reads happening on a separate machine from writes. That may well not be possible in your case. -- Richard Huxton Archonet Ltd