169 похожих чатов

Hello, I have a cluster of pg (using patroni) at the

moment PG14 we wish to upgrade to 16.

The main usage is mostly writing data (metadata and states0, and even some of selects are part of the insert/update transaction operations to determine some stages of a stateless operations.

I have many connections to the db at the peak usage of the system, that generate big load on the primary (can arrive to 200 tasks waiting).

All of the servers (three) are on "bare metal" (self managed proxmox).

The system must be responsive in few milliseconds (the lower the better) with the stateless states and metadata, so it is impossible to use MQ/Task queue and waiting for writing in bulks.

Do you know a good tool/proxy to manage such usage to reduce if possible some of the load, or better way to manage cluster of primary-primary-secondary?

Thank you

13 ответов

6 просмотров

If you are using Patroni, take a look at https://www.dbi-services.com/blog/major-postgresql-version-upgrade-in-a-patroni-cluster/ If you aren't using Patroni, think about using it.

PgBouncer is a very good and lightweight connection pooler. But at least it should run in transaction mode, you might have to change your client software. https://www.pgbouncer.org/

ℹ️ K
thank you

I've written a blog post about poolers https://proopensource.it/blog/postgresql-connection-poolers

ℹ️-K Автор вопроса
Stefanie Janine Stölting
I've written a blog post about poolers https://pro...

Very interesting, great post, I did not know of odyssey. my usage is always with transactions and prepared statements. how does pgpool will find out what is the current primary/leader if it does not handle the cluster?

ℹ️ K
Very interesting, great post, I did not know of o...

Patroni can handle that, too. There's a public Ansible project which can handle the whole installation process, https://github.com/vitabaks/postgresql_cluster

ℹ️-K Автор вопроса
Stefanie Janine Stölting
I've written a blog post about poolers https://pro...

In pgbouncer I can see some dangerous timeouts such as query_wait_timeout etc....should we simply disable them

Rajesh Kumar
In pgbouncer I can see some dangerous timeouts suc...

First check what is running: - long running transactions: check your application, apply changes to reduce them in both, amount and runtime - long running queries: try to optimize them Otherwise you might run into the same problems again. You have hopefully installed https://www.postgresql.org/docs/current/pgstatstatements.html If not, now is the time.

Stefanie Janine Stölting
First check what is running: - long running transa...

I was testing in dev and I am pretty sure no long running transactions.....I still see query wait timeout error. So I disabled dangerous timeouts

Rajesh Kumar
I was testing in dev and I am pretty sure no long ...

Queries with missing indexes, client connections kept open , configuration failure, the default configuration of PostgreSQL is not useful. Configuration failure in PgBouncer.

Stefanie Janine Stölting
Queries with missing indexes, client connections k...

Let's say I execute some queries in a session and when exit from session by giving \q. Then when I connect using psql and check in pg_stat_activity I see those queries are in idle . Is there anything fundamentally wrong ?

Похожие вопросы

Обсуждают сегодня

а через ESC-код ?
Alexey Kulakov
29
30500 за редактор? )
Владимир
47
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
13
Недавно Google Project Zero нашёл багу в SQLite с помощью LLM, о чём достаточно было шумно в определённых интернетах, которые сопровождались рассказами, что скоро всех "ибешни...
Alex Sherbakov
5
program test; {$mode delphi} procedure proc(v: int32); overload; begin end; procedure proc(v: int64); overload; begin end; var x: uint64; begin proc(x); end. Уж не знаю...
notme
6
Как передать управляющий символ в открытую через CreateProcess консоль? Собсна, есть процедура: procedure TRedirectThread.WriteData(Data: OEMString); var Written: Cardinal;...
Serjone
6
вы делали что-то подобное и как? может есть либы готовые? увидел картинку нокода, где всё линиями соединено и стало интересно попробовать то же в ddl на lua сделать. решил с ч...
Victor
8
Ребят в СИ можно реализовать ООП?
Николай
33
Подскажите пожалуйста, как в CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); получить наз...
A Z
7
Карта сайта