Re: PostgreSQL, and ODBC statement handles

From: "Inoue, Hiroshi" <h-inoue(at)dream(dot)email(dot)ne(dot)jp>
To: Reza Taheri <rtaheri(at)vmware(dot)com>
Cc: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: PostgreSQL, and ODBC statement handles
Date: 2017-05-04 07:11:13
Message-ID: 33cdd367-6e70-aab2-fdb1-8637d13d23ff@dream.email.ne.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

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(at)dream(dot)email(dot)ne(dot)jp
> <mailto:h-inoue(at)dream(dot)email(dot)ne(dot)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
>
> このメッセージにウイルスは検出されませんでした。
> AVG によってチェックされました - www.avg.com
> <http://www.avg.com/email-signature>
> バージョン: 2016.0.8013 / ウイルスデータベース:4776/14426 -
> リリース日:2017/05/03
>

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Reza Taheri 2017-05-04 07:57:34 Re: PostgreSQL, and ODBC statement handles
Previous Message Reza Taheri 2017-05-04 06:17:47 Re: PostgreSQL, and ODBC statement handles