Re: Ragged latency log data in multi-threaded pgbench

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Ragged latency log data in multi-threaded pgbench
Date: 2010-03-16 02:02:12
Message-ID: 27910.1268704932@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> writes:
> Greg Smith <greg(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Takahiro Itagaki 2010-03-16 02:13:37 Re: Ragged latency log data in multi-threaded pgbench
Previous Message Greg Smith 2010-03-16 01:59:05 Re: Ragged latency log data in multi-threaded pgbench