Re: Ragged latency log data in multi-threaded pgbench - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Ragged latency log data in multi-threaded pgbench
Date
Msg-id 27910.1268704932@sss.pgh.pa.us
Whole thread Raw
In response to Re: Ragged latency log data in multi-threaded pgbench  (Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>)
Responses Re: Ragged latency log data in multi-threaded pgbench
List pgsql-hackers
Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp> writes:
> Greg Smith <greg@2ndquadrant.com> wrote:
>> It looks like the switch between clients running on separate workers can 
>> lead to a mix of their respective lines showing up though.

> Oops. There might be two solutions for the issue:
>   1. Use explicit locks. The lock primitive will be pthread_mutex for
>      multi-threaded implementations or semaphore for multi-threaded ones.
>   2. Use per-thread log files.
>      File names would be "pgbench_log.<main-process-id>.<thread-id>".

I think #1 is out of the question, as the synchronization overhead will
do serious damage to the whole point of having a multithreaded pgbench.
#2 might be a reasonable idea.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Re: Ragged latency log data in multi-threaded pgbench
Next
From: Takahiro Itagaki
Date:
Subject: Re: Ragged latency log data in multi-threaded pgbench