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 ответов

12 просмотров

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 ?

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

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

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
14
Добрый день! Скажите пожалуйста, а какие программы вы бы рекомендовали написать для того, чтобы научиться управлять памятью? Можно написать динамический массив, можно связный ...
Филипп
7
Недавно Google Project Zero нашёл багу в SQLite с помощью LLM, о чём достаточно было шумно в определённых интернетах, которые сопровождались рассказами, что скоро всех "ибешни...
Alex Sherbakov
5
Ребят в СИ можно реализовать ООП?
Николай
33
https://github.com/erlang/otp/blob/OTP-27.1/lib/kernel/src/logger_h_common.erl#L174 https://github.com/erlang/otp/blob/OTP-27.1/lib/kernel/src/logger_olp.erl#L76 15 лет назад...
Maksim Lapshin
20
Карта сайта