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 7159352BE2 for ; Fri, 19 Aug 2005 15:12:02 -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 64054-07 for ; Fri, 19 Aug 2005 18:11:57 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id 8F21752B87 for ; Fri, 19 Aug 2005 15:11:55 -0300 (ADT) Received: (qmail 5869 invoked from network); 19 Aug 2005 20:12:15 +0200 Received: from unknown (HELO localhost) (boutiquenumerique-lists@192.168.0.4) by boutiquenumerique.com with SMTP; 19 Aug 2005 20:12:15 +0200 Date: Fri, 19 Aug 2005 20:11:54 +0200 To: "Tom Lane" , "Bob Ippolito" Subject: Re: sustained update load of 1-2k/sec Cc: "Mark Cotner" , pgsql-performance@postgresql.org References: <20050819082404.53751.qmail@web32915.mail.mud.yahoo.com> <67788A4A-4011-49AB-B329-683FD9532661@redivi.com> <17690.1124458553@sss.pgh.pa.us> From: PFC Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: In-Reply-To: <17690.1124458553@sss.pgh.pa.us> User-Agent: Opera M2/8.0 (Linux, build 1095) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 required=5 tests=[AWL=0.005] X-Spam-Level: X-Archive-Number: 200508/275 X-Sequence-Number: 14022 > 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 You use UDP which is a connectionless protocol... then why use threads ? I'd advise this : Use asynchronous network code (one thread) to do your network stuff. This will lower the CPU used by this code immensely. Every minute, dump a file contianing everything to insert into the table. Use another thread to COPY it into the DB, in a temporary table if you wish, and then INSERT INTO ... SELECT. This should be well adapted to your requirements.