pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: How to setup only one connection for the whole event loop?
Date: Fri, 15 Feb 2019 08:08:10 -0800
Message-ID: <6aaf55f2-145e-a395-b372-41cae0037f06@aklaver.com> (raw)
In-Reply-To: <1639716788.536278.1550160364895@mail.yahoo.com>
References: <1639716788.536278.1550160364895.ref@mail.yahoo.com>
	<1639716788.536278.1550160364895@mail.yahoo.com>

On 2/14/19 8:06 AM, Dominic Gua�a wrote:
> Dear all,
> 
> I am new to postgresql and I am creating a c program that can receive 
> request from different users. I want to maximize the performance of 
> postgresql so I intend to just create 1 connection that would service 
> all queries of different users. How do I do this?

Use one of the existing Postgres poolers?:

http://www.pgpool.net/mediawiki/index.php/Main_Page

http://pgbouncer.github.io/

> 
> Do I create a new connection each time there is a new request like how 
> it goes in MySQL or can I just have one connection that is established 
> in my `main` function?
> 
> Sincerely


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (3+ messages)  latest in thread

Message-ID: <6aaf55f2-145e-a395-b372-41cae0037f06@aklaver.com>
Permalink:  ../6aaf55f2-145e-a395-b372-41cae0037f06@aklaver.com/
Also on:    postgresql.org/message-id/6aaf55f2-145e-a395-b372-41cae0037f06@aklaver.com

 · 

reply

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-general@postgresql.org
  Cc: adrian.klaver@aklaver.com
  Subject: Re: How to setup only one connection for the whole event loop?
  In-Reply-To: <6aaf55f2-145e-a395-b372-41cae0037f06@aklaver.com>
  References: <1639716788.536278.1550160364895.ref@mail.yahoo.com> <1639716788.536278.1550160364895@mail.yahoo.com> <6aaf55f2-145e-a395-b372-41cae0037f06@aklaver.com>

* 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