[GENERAL] Streaming replication bandwith per table

Поиск
Список
Период
Сортировка
От Maeldron T.
Тема [GENERAL] Streaming replication bandwith per table
Дата
Msg-id CAKatfSkgjn2-ZWxHNQJ6-6QC0aewxrMU5qYspfX8NThaV-oRGw@mail.gmail.com
обсуждение исходный текст
Ответы Re: [GENERAL] Streaming replication bandwith per table
Список pgsql-general
Hello,

tl;dr

Streaming replication generates too much traffic to set it up between different regions for financial reasons. The streaming replication would cost more than every other hosting expense altogether (including every the traffic, even though it’s web and huge amount of emails).

Is there a way to see in the log how much bandwidth is used per table? 

Details:

My only idea is to improve the design.

I believe the source of the issue is tables involved in many to many relations with frequent updates. 

The structure varies. Sometimes it’s:

table_a_id_1 | table_a_id_2

other times:

table_b_id_1 | table_b_id_2 | float value

and:

integer value | table_c_id


It’s simple, but the performance is a key factor.

Depending on the relation (whether it had an additional value or not), the expected usage, and my mood, I implemented them using either classical pairs or arrays with gin indices:

table_a_id_1 | [table_a_id_2, table_a_id_7, table_a_id_9,...]

and:

integer value | [table_a_id_1, table_a_id_5, table_a_id_6, ...]

There are millions of records in the tables with arrays. The "normal" pairs have tens of million and above. One table could have about 40 billion values in theory (it doesn’t but it’s growing).


I can guess which tables are problematic and what to change, but:

* It’s difficult to simulate real-life usage 
* The usage patterns are different from table to table
* If I’m wrong, I waste time and resources (and downtime) to make it even worse

I know the updates on the arrays cost much more (it’s also a performance issue) but the table takes magnitudes less space this way. I even considered jsonb when there are also float values for each pair.

What to change in the design depends on the real-life use. How can I measure the bandwidth usage per table in streaming replication? I don’t see a way to emulate it with realistic results.

M

PS: except the updates on the arrays, the performance itself is satisfying for each table. It’s only the bandwidth usage that would hurt






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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: [GENERAL] effective_io_concurrency increasing
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [GENERAL] Streaming replication bandwith per table