X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3E19152C34 for ; Fri, 19 Aug 2005 10:58:42 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18998-05 for ; Fri, 19 Aug 2005 13:58:37 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.188]) by svr1.postgresql.org (Postfix) with ESMTP id C64FD52C1F for ; Fri, 19 Aug 2005 10:58:35 -0300 (ADT) Received: from p548F1B85.dip0.t-ipconnect.de [84.143.27.133] (helo=pse.dyndns.org) by mrelayeu.kundenserver.de with ESMTP (Nemesis), id 0MKwh2-1E67OH3mTv-00034N; Fri, 19 Aug 2005 15:58:37 +0200 Received: from p548f1e1e.dip0.t-ipconnect.de ([84.143.30.30] helo=[10.10.11.120]) by pse.dyndns.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.44) id 1E67OF-0000dE-Ht; Fri, 19 Aug 2005 15:58:36 +0200 Message-ID: <4305E57E.1010604@pse-consulting.de> Date: Fri, 19 Aug 2005 15:58:22 +0200 From: Andreas Pflug User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Bob Ippolito , Mark Cotner , pgsql-performance@postgresql.org Subject: Re: sustained update load of 1-2k/sec References: <20050819082404.53751.qmail@web32915.mail.mud.yahoo.com> <67788A4A-4011-49AB-B329-683FD9532661@redivi.com> <17690.1124458553@sss.pgh.pa.us> In-Reply-To: <17690.1124458553@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de login:0ce7ee5c3478b8d72edd8e05ccd40b70 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.073 required=5 tests=[AWL=-0.769, FORGED_RCVD_HELO=0.05, RCVD_IN_NJABL_DUL=1.655, RCVD_IN_SORBS_DUL=0.137] X-Spam-Level: * X-Archive-Number: 200508/260 X-Sequence-Number: 14007 Tom Lane wrote: >Bob Ippolito writes: > > >>If you don't want to optimize the whole application, I'd at least >>just push the DB operations down to a very small number of >>connections (*one* might even be optimal!), waiting on some kind of >>thread-safe queue for updates from the rest of the system. >> >> > >While I agree that hundreds of threads seems like overkill, I think the >above advice might be going too far in the other direction. The problem >with single-threaded operation is that any delay affects the whole >system --- eg, if you're blocked waiting for disk I/O, the CPU doesn't >get anything done either. You want enough DB connections doing things >in parallel to make sure that there's always something else useful to do >for each major component. This is particularly important for Postgres, >which doesn't do any internal query parallelization (not that it would >help much anyway for the sorts of trivial queries you are worried about). >If you have, say, a 4-way CPU you want at least 4 active connections to >make good use of the CPUs. > >I'd suggest trying to build the system so that it uses a dozen or two >active database connections. If that doesn't match up to the number of >polling activities you want to have in flight at any instant, then you >can do something like what Bob suggested on the client side to bridge >the gap. > >As far as the question "can PG do 1-2k xact/sec", the answer is "yes >if you throw enough hardware at it". Spending enough money on the >disk subsystem is the key ... > > The 1-2k xact/sec for MySQL seems suspicious, sounds very much like write-back cached, not write-through, esp. considering that heavy concurrent write access isn't said to be MySQLs strength... I wonder if preserving the database after a fatal crash is really necessary, since the data stored sounds quite volatile; in this case, fsync=false might be sufficient. Regards, Andreas