Re: db-connections (application architecture)

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: db-connections (application architecture)
Дата
Msg-id ae39ddce-c932-a9e4-14ce-bb9ef55b35c4@aklaver.com
обсуждение исходный текст
Ответ на db-connections (application architecture)  (Mark Moellering <markmoellering@psyberation.com>)
Список pgsql-general
On 11/15/18 7:09 AM, Mark Moellering wrote:
> So, I am working on some system designs for a web application, and I 
> wonder if there is any definitive answer on how to best connect to a 
> postgres database.
> 
> I could have it so that each time a query, or set of queries, for a 
> particular request, needs to be run, a new connection is opened, queries 
> are run, and then connection is closed / dropped.
> 
> OR, I could create a persistent connection that will remain open as long 
> as a user is logged in and then any queries are run against the open 
> connection.
> 
> I can see how, for only a few (hundreds to thousands) of users, the 
> latter might make more sense but if I need to scale up to millions, I 
> might not want all of those connections open.
> 
> Any idea of how much time / overhead is added by opening and closing a 
> connection everytime?
> 
> Any and all information is welcome.

Connection pooling?

In no particular order:

https://pgbouncer.github.io/

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

> 
> Thanks in advance
> 
> -- Mark M


-- 
Adrian Klaver
adrian.klaver@aklaver.com


В списке pgsql-general по дате отправления:

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: db-connections (application architecture)
Следующее
От: Mark Moellering
Дата:
Сообщение: Re: db-connections (application architecture)