Re: Client Server performance & UDS

From: Rick Otten <rottenwindfish(at)gmail(dot)com>
To: "Kevin(dot)Hughes(at)uk(dot)fujitsu(dot)com" <Kevin(dot)Hughes(at)uk(dot)fujitsu(dot)com>
Cc: "pgsql-performa(dot)" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Client Server performance & UDS
Date: 2017-05-30 10:17:37
Message-ID: CAMAYy4K+a8E0sWrDY-1Zhp8WPM_89enkHq07wqx-XsrgjBhm3g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Establishing a connection with a PostgreSQL database is a very expensive
process on the database server. On the other hand, establishing a
connection with pgbouncer is very fast. Offloading the connection
management to pgbouncer can significantly reduce the connection set up time.

I've found it to help even with applications that have built-in connection
pooling.

If your clients are keeping persistent connections open to the database,
and the latency you are experiencing is within the transaction itself, you
might look at disk I/O for your WAL (write ahead logs) and take a closer
look at WAL and checkpoint tuning.

On Tue, May 30, 2017 at 3:34 AM, Kevin(dot)Hughes(at)uk(dot)fujitsu(dot)com <
Kevin(dot)Hughes(at)uk(dot)fujitsu(dot)com> wrote:

> Hi Rick thanks for the reply.
>
>
>
> Our aim is to minimise latency hence we have a dedicated 1:1 relationship
> between the client and the server. If I use connection pooling surely this
> introduced latency – getting a server from the pool establishing the
> connection?
>
>
>
> Am I missing something?
>
>
>
>
>
> *From:* Rick Otten [mailto:rottenwindfish(at)gmail(dot)com]
> *Sent:* 27 May 2017 13:27
> *To:* Hughes, Kevin <Kevin(dot)Hughes(at)uk(dot)fujitsu(dot)com>
> *Cc:* pgsql-performa. <pgsql-performance(at)postgresql(dot)org>
> *Subject:* Re: [PERFORM] Client Server performance & UDS
>
>
>
> You should have a layer such as pgbouncer between your pg instance and
> your application. It is designed to mitigate the access latency issues you
> describe.
>
>
>
> On May 26, 2017 10:03 AM, "Kevin(dot)Hughes(at)uk(dot)fujitsu(dot)com" <
> Kevin(dot)Hughes(at)uk(dot)fujitsu(dot)com> wrote:
>
> Hi,
>
>
>
> This is a general question around this performance area
> rather than a specific performance problem.....so I apologise now for a
> lack of a specific detail.
>
>
>
> We have an application that does many small actions on the
> DB – and it’s a small DB (a 50/100 Mbytes) so we would expect it to be
> contained in memory. Accesses need to be low latency – unfortunately there
> are “serial” accesses where the result of one access governs the next.
> Luckily the work to be done by the DB is, we believe, very simple and
> hence fast. Everything is running on one (large) server so we use UDS to
> connect the client to the server.
>
>
>
> Out observation (suspicion) is that the latency of the access, as opposed
> to the cost of the query, is high. Having done some investigation we
> believe the UDS latency may be contributing AND the cost imposed by
> postgres in “formatting” the messages between the client and server
> (transformation to network format?).
>
>
>
> We will try and get underneath this with real results/measurements but I
> would appreciate any comments pointers on what we are doing and how/if we
> can optimise this style of applications
>
>
>
>
>
> Cheers
>
>
>
>
>
>
>
>
>
>
> Unless otherwise stated, this email has been sent from Fujitsu Services
> Limited (registered in England No 96056); Fujitsu EMEA PLC (registered in
> England No 2216100) both with registered offices at: 22 Baker Street,
> London W1U 3BW; PFU (EMEA) Limited, (registered in England No 1578652) and
> Fujitsu Laboratories of Europe Limited (registered in England No. 4153469)
> both with registered offices at: Hayes Park Central, Hayes End Road, Hayes,
> Middlesex, UB4 8FE.
> This email is only for the use of its intended recipient. Its contents are
> subject to a duty of confidence and may be privileged. Fujitsu does not
> guarantee that this email has not been intercepted and amended or that it
> is virus-free.
>
>
> Unless otherwise stated, this email has been sent from Fujitsu Services
> Limited (registered in England No 96056); Fujitsu EMEA PLC (registered in
> England No 2216100) both with registered offices at: 22 Baker Street,
> London W1U 3BW; PFU (EMEA) Limited, (registered in England No 1578652) and
> Fujitsu Laboratories of Europe Limited (registered in England No. 4153469)
> both with registered offices at: Hayes Park Central, Hayes End Road, Hayes,
> Middlesex, UB4 8FE.
> This email is only for the use of its intended recipient. Its contents are
> subject to a duty of confidence and may be privileged. Fujitsu does not
> guarantee that this email has not been intercepted and amended or that it
> is virus-free.
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Justin Pryzby 2017-05-30 10:52:15 Re: join estimate of subqueries with range conditions and constraint exclusion
Previous Message Kevin.Hughes@uk.fujitsu.com 2017-05-30 07:34:26 Re: Client Server performance & UDS