From: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
To: Reza Taheri <rtaheri@vmware.com>
Cc: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: PostgreSQL, and ODBC statement handles
Date: Thu, 4 May 2017 17:15:40 +0900
Message-ID: <fea613d3-e5a3-ff7f-9fb3-0ef4ac5251bd@dream.email.ne.jp> (raw)
In-Reply-To: <9A7D1174-B33A-43B1-813F-65F8BF42E487@vmware.com>
References: <AEDF45A5-DED8-4799-942B-57475EF72C17@vmware.com>
<ff0953af-afa4-f567-acd3-1b9be04b19af@dream.email.ne.jp>
<7EF51648-F53F-4C9D-BEAD-80D4CC900FA8@vmware.com>
<33cdd367-6e70-aab2-fdb1-8637d13d23ff@dream.email.ne.jp>
<9A7D1174-B33A-43B1-813F-65F8BF42E487@vmware.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
Hi Reza,
On 2017/05/04 16:57, Reza Taheri wrote:
>
> On 5/4/17, 12:11 AM, "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp
> <mailto:h-inoue@dream.email.ne.jp>> wrote:
>
> On 2017/05/04 15:17, Reza Taheri wrote:
>
> Hi Hiroshi,
>
> In /etc/odbcinst.ini, I set “Threading = 0”. I can
> see multiple server processes in transaction in the backend
> server. The contention appears to be only for access to the
> statement handle, not actual database access. For example, when I
> replaced looping over SQLFetch(stmt) with a single
> SQLFetchScroll(stmt, SQL_FETCH_NEXT, 0), I got better results.
> Same with reducing the frequency of calls to SQLBindCol()
>
> Thanks,
> Reza
>
> On 5/3/17, 10:38 PM, "Inoue, Hiroshi" <h-inoue@dream.email.ne.jp
> <mailto:h-inoue@dream.email.ne.jp>> wrote:
>
> Hi Reza,
>
> How are you setting 'Threading' in odbcinst.ini?
>
> regards,
> Hiroshi
>
> On 2017/05/04 14:08, Reza Taheri wrote:
>
> I am running a benchmark (TPCx-V) with a single process on the
> client system handing all the load. Each connection to the
> server is in a separate thread with its own connection to
> PGSQL, and its own connection handle and statement handle. I
> am facing a contention problem with ODBC on the client side.
> strace and perf top show we are serializing over what appears
> to be accesses to the ODBC statement handlepgsq. Contention
> goes away if I use multiple processes instead of multiple
> threads within a process.
>
> I suppose I don’t understand the concept of “handles” well,
> but I am surprised that
>
>
>
> all the threads get the same connection handle number and the
> same statement handle number.
>
>
> Hmm, strange. Can I confirm the situation?
>
> regards,
> Hiroshi Inoue
>
>
> Does that mean some data structure is shared between the
> different threads? Is there a way to force different statement
> handles (or handle numbers???) for different threads within
> one process? I have asked this question on the ODBC mailing
> list, and they suggested it could be something in the
> postgresql driver. I can provide detailed performance data,
> but maybe someone can help me figure out what might be a very
> basic configuration or parameter setting problem. I am running
> the following RPMs on RHEL 7.1:
>
> postgresql93-9.3.5-2PGDG.rhel7.x86_64
>
> postgresql93-odbc-09.03.0300-1PGDG.rhel7.x86_64
>
> unixODBC-2.3.1-10.el7.x86_64
>
> Thanks,
> Reza
>
> Hi Hiroshi,
>
> I am not sure what you mean by “Can I confirm the situation”. Is
> there some data you would like me to collect and share?
>
I'd like to see the record of each thread what connection handle was
allocated and where it was connected to.
regards,
Hiroshi Inoue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: h-inoue@dream.email.ne.jp, rtaheri@vmware.com
Subject: Re: PostgreSQL, and ODBC statement handles
In-Reply-To: <fea613d3-e5a3-ff7f-9fb3-0ef4ac5251bd@dream.email.ne.jp>
References: <AEDF45A5-DED8-4799-942B-57475EF72C17@vmware.com> <ff0953af-afa4-f567-acd3-1b9be04b19af@dream.email.ne.jp> <7EF51648-F53F-4C9D-BEAD-80D4CC900FA8@vmware.com> <33cdd367-6e70-aab2-fdb1-8637d13d23ff@dream.email.ne.jp> <9A7D1174-B33A-43B1-813F-65F8BF42E487@vmware.com> <fea613d3-e5a3-ff7f-9fb3-0ef4ac5251bd@dream.email.ne.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox