Re: Transactions involving multiple postgres foreign servers, take 2

Поиск
Список
Период
Сортировка
От Masahiko Sawada
Тема Re: Transactions involving multiple postgres foreign servers, take 2
Дата
Msg-id CAD21AoBHo8-84DwwJ1ApWEu2KPPHOacVdk4pzyc4R-aAMppsYw@mail.gmail.com
обсуждение исходный текст
Ответ на RE: Transactions involving multiple postgres foreign servers, take 2  ("r.takahashi_2@fujitsu.com" <r.takahashi_2@fujitsu.com>)
Ответы RE: Transactions involving multiple postgres foreign servers, take 2
Список pgsql-hackers
Sorry for the late reply.

On Tue, Jul 6, 2021 at 3:15 PM r.takahashi_2@fujitsu.com
<r.takahashi_2@fujitsu.com> wrote:
>
> Hi,
>
>
> I'm interested in this patch and I also run the same test with Ikeda-san's fxact_update.pgbench.

Thank you for testing!

> In my environment (poor spec VM), the result is following.
>
> * foreign_twophase_commit = disabled
> 363tps
>
> * foreign_twophase_commit = required (It is necessary to set -R ${RATE} as Ikeda-san said)
> 13tps
>
>
> I analyzed the bottleneck using pstack and strace.
> I noticed that the open() during "COMMIT PREPARED" command is very slow.
>
> In my environment the latency of the "COMMIT PREPARED" is 16ms.
> (On the other hand, the latency of "COMMIT" and "PREPARE TRANSACTION" is 1ms)
> In the "COMMIT PREPARED" command, open() for wal segment file takes 14ms.
> Therefore, open() is the bottleneck of "COMMIT PREPARED".
> Furthermore, I noticed that the backend process almost always open the same wal segment file.
>
> In the current patch, the backend process on foreign server which is associated with the connection from the resolver
processalways run "COMMIT PREPARED" command.
 
> Therefore, the wal segment file of the current "COMMIT PREPARED" command probably be the same with the previous
"COMMITPREPARED" command.
 
>
> In order to improve the performance of the resolver process, I think it is useful to skip closing wal segment file
duringthe "COMMIT PREPARED" and reuse file descriptor.
 
> Is it possible?

Not sure but it might be possible to keep holding an xlogreader for
reading PREPARE WAL records even after the transaction commit. But I
wonder how much open() for wal segment file accounts for the total
execution time of 2PC. 2PC requires 2 network round trips for each
participant. For example, if it took 500ms in total, we would not get
benefits much from the point of view of 2PC performance even if we
improved it from 14ms to 1ms.

Regards,

--
Masahiko Sawada
EDB:  https://www.enterprisedb.com/



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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: Transactions involving multiple postgres foreign servers, take 2
Следующее
От: Bharath Rupireddy
Дата:
Сообщение: Re: bugfix: when the blocksize is 32k, the function page_header of pageinspect returns negative numbers.