Re: Ragged latency log data in multi-threaded pgbench

From: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Ragged latency log data in multi-threaded pgbench
Date: 2010-03-16 00:46:47
Message-ID: 20100316094647.9C19.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


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>".

Which is better, or another idea?

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-03-16 01:12:53 Re: Should we throw error when converting a nonexistent/ambiguous timestamp?
Previous Message Robert Haas 2010-03-16 00:40:49 Re: Getting to beta1