From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: PostgreSQL Developers <pgsql-hackers@postgresql.org>
Subject: Re: PATCH: pgbench - merging transaction logs
Date: Tue, 17 Mar 2015 16:27:25 +0100 (CET)
Message-ID: <alpine.DEB.2.10.1503171614580.31431@sto> (raw)
In-Reply-To: <CA+TgmoZAuB+ZfMhS-LSjqsyv=gA7kBjADWf_A34cUeVTrNUmVA@mail.gmail.com>
References: <54FCB11B.5050907@2ndquadrant.com>
<alpine.DEB.2.10.1503150945070.4015@sto>
<5505CF30.7030308@2ndquadrant.com>
<alpine.DEB.2.10.1503151935160.4015@sto>
<CA+TgmoZAuB+ZfMhS-LSjqsyv=gA7kBjADWf_A34cUeVTrNUmVA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Hello,
>> I agree, but I think it is due to the multi process thread emulation: if you
>> have real threads, you can do a simple fprintf, possibly with some mutex,
>> and you're done. There is really nothing to do to implement this
>> feature.
>
> I think that's probably not a good idea, because fprintf() might then
> become a bottleneck. I fixed a similar problem with random() in
> commit 4af43ee3f165c8e4b332a7e680a44f4b7ba2d3c1. Even though the
> locking was happening inside libc, it was still locking, and it still
> caused a contention problem.
The fprintf we are talking about occurs at most once per pgbench
transaction, possibly much less when aggregation is activated, and this
transaction involves networks exchanges and possibly disk writes on the
server.
So I would have thought that the risk of contention because of such a lock
would be very low in this case. If it really becomes a bottleneck, it
means a lot of threads doing a lot of small transactions, and I would
suggest that using the aggregated option would be the right answer to
that.
--
Fabien.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: coelho@cri.ensmp.fr, robertmhaas@gmail.com, tomas.vondra@2ndquadrant.com
Subject: Re: PATCH: pgbench - merging transaction logs
In-Reply-To: <alpine.DEB.2.10.1503171614580.31431@sto>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox