Re: Fix around conn_duration in pgbench - Mailing list pgsql-hackers

From Yugo NAGATA
Subject Re: Fix around conn_duration in pgbench
Date
Msg-id 20210805180219.cb69b58c53db2311280066af@sraoss.co.jp
Whole thread Raw
In response to Re: Fix around conn_duration in pgbench  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: Fix around conn_duration in pgbench  (Fujii Masao <masao.fujii@oss.nttdata.com>)
List pgsql-hackers
Hello Fujii-san,

On Thu, 5 Aug 2021 16:16:48 +0900
Fujii Masao <masao.fujii@oss.nttdata.com> wrote:

> 
> 
> On 2021/08/01 14:50, Yugo NAGATA wrote:
> > When -C is not specified, the disconnection time is not measured even in
> > the patch for v14+. I don't think it is a problem because the
> > disconnection delay at the end of benchmark almost doesn't affect the tps.
> 
> What about v13 or before? That is, in v13, even when -C is not specified,
> both the connection and disconnection delays are measured. Right?

No. Although there is a code measuring the thread->conn_time around
disconnect_all() in v13 or before;

done:
    INSTR_TIME_SET_CURRENT(start);
    disconnect_all(state, nstate);
    INSTR_TIME_SET_CURRENT(end);
    INSTR_TIME_ACCUM_DIFF(thread->conn_time, end, start);

this is a no-op because finishCon() is already called at CSTATE_ABORTED or 
CSTATE_FINISHED. Therefore, in the end, the disconnection delay is not
measured even in v13.

Regards,
Yugo Nagata


-- 
Yugo NAGATA <nagata@sraoss.co.jp>



pgsql-hackers by date:

Previous
From: "osumi.takamichi@fujitsu.com"
Date:
Subject: RE: Skipping logical replication transactions on subscriber side
Next
From: Michael Banck
Date:
Subject: Re: Commitfest overflow