Re: [PATCH] pgbench --throttle (submission 7 - with lag measurement)

From: Greg Smith <greg(at)2ndQuadrant(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] pgbench --throttle (submission 7 - with lag measurement)
Date: 2013-07-13 15:37:49
Message-ID: 51E1744D.50104@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 6/30/13 2:04 AM, Fabien COELHO wrote:
> My guess is the OS. "PQfinish" or "select" do/are systems calls that
> present opportunities to switch context. I think that the OS is passing
> time with other processes on the same host, expecially postgres
> backends, when it is not with the client.

I went looking for other instances of this issue in pgbench results,
that's what I got lost in the last two weeks. It's subtle because the
clients normally all end in one very short burst of time, but I have
found evidence of PQfinish issues elsewhere. Evidence still seems to
match the theory that throttling highlights this only because it spreads
out the ending a bit more. Also, it happens to be a lot worse on the
Mac I did initial testing with, and I don't have nearly as many Mac
pgbench results.

There's a refactoring possible here that seems to make this whole class
of problem go away. If I change pgbench so that PQfinish isn't called
for any client until *all* of the clients are actually finished with
transactions, the whole issue goes away. I'm going to package that hack
the right way into its own little change, revisit the throttling code,
and then this all should wrap up nicely. I'd like to get this one out
of the commitfest so I can move onto looking at something else.

--
Greg Smith 2ndQuadrant US greg(at)2ndQuadrant(dot)com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2013-07-13 16:13:13 Re: [PATCH] pgbench --throttle (submission 7 - with lag measurement)
Previous Message Peter Eisentraut 2013-07-13 14:12:37 ecpg prototype mismatch