Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 2B75B632F3D for ; Wed, 2 Sep 2009 16:52:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 55667-01 for ; Wed, 2 Sep 2009 19:52:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f216.google.com (mail-ew0-f216.google.com [209.85.219.216]) by mail.postgresql.org (Postfix) with ESMTP id 9BD6963539B for ; Wed, 2 Sep 2009 16:52:35 -0300 (ADT) Received: by ewy12 with SMTP id 12so1120292ewy.24 for ; Wed, 02 Sep 2009 12:52:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.131.39 with SMTP id i39mr9447252ebn.98.1251921153402; Wed, 02 Sep 2009 12:52:33 -0700 (PDT) In-Reply-To: <895e58dd0908272250q63caa690p2049df133dd536c5@mail.gmail.com> References: <895e58dd0908241736q3575cdc2v461d879c5b5f9dcb@mail.gmail.com> <4A9334C4.2060503@opencloud.com> <895e58dd0908250815m1a8aada0qc9d3f0bde9c7a303@mail.gmail.com> <895e58dd0908250951m1aa4baabnf1695c9e681aa278@mail.gmail.com> <4A946B7A.60408@opencloud.com> <895e58dd0908260201g59762012ka2349eada052ab6d@mail.gmail.com> <4A95CE4B.5050107@opencloud.com> <895e58dd0908261737t20f5b7dbsd9ae546a34264a7@mail.gmail.com> <4A95D980.3070809@opencloud.com> <895e58dd0908272250q63caa690p2049df133dd536c5@mail.gmail.com> Date: Wed, 2 Sep 2009 12:52:33 -0700 Message-ID: <895e58dd0909021252r67901700wc5cbcf74db9916f8@mail.gmail.com> Subject: Re: PGStream synchronization From: Maciek Sakrejda To: Oliver Jowett Cc: pgsql-jdbc@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.413 tagged_above=-10 required=5 tests=AWL=0.186, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200909/5 X-Sequence-Number: 19952 So, for what it's worth, the hybrid approach somehow turned out to be a massive, massive performance regression in our tests. We're still looking into why. The only thing I've found that works consistently so far is to *always* just close the pgStream socket (without sending anything), which is only marginally better in theory than the current situation (and probably actually worse in practice, since you're unlikely to see concurrent use of the same connection, whereas having a clean protocol shutdown is nice). I'll let the list know if we find a better approach. On Thu, Aug 27, 2009 at 10:50 PM, Maciek Sakrejda wrote: >> How about, instead of using raw monitor synchronization to provide >> mutual exclusion on access to the stream, we use a lock object (i.e. >> something similar to java.util.concurrent.locks.Lock, though we can't >> use exactly that class before 1.5 obviously), try to grab the lock >> before close, and behave differently depending on if we succeeded or not. -- Maciek Sakrejda | Software Engineer | Truviso (650) 242-3500 Main (650) 242-3501 F msakrejda@truviso.com www.truviso.com