Re: pgbench cpu overhead (was Re: lazy vxid locks, v1)

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: pgbench cpu overhead (was Re: lazy vxid locks, v1)
Date: 2011-06-14 19:56:56
Message-ID: BANLkTikCcLyKyMPMhksMJnH=x0VV60hGfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 13, 2011 at 9:09 PM, Alvaro Herrera
<alvherre(at)commandprompt(dot)com> wrote:

> I noticed that pgbench's doCustom (the function highest in the profile
> posted) returns doing nothing if the connection is supposed to be
> "sleeping"; seems an open door for busy waiting.  I didn't check the
> rest of the code to see if there's something avoiding that condition.

Yes, there is a "select" in threadRun that avoids that. Also, I don't
think anyone would but in a "sleep" in this particular type of pgbench
run.

> I
> also noticed that it seems to be very liberal about calling
> INSTR_TIME_SET_CURRENT in the same function which perhaps could be
> optimizing by calling it a single time at entry and reusing the value,
> but I guess that would show up in the profile as a kernel call so it's
> maybe not a problem.

I think that only gets called when you specifically asked for
latencies or for logging, or when making new connection (which should
be rare)

Cheers,

Jeff

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2011-06-14 20:00:31 Re: Detailed documentation for external calls (threading, shared resources etc)
Previous Message Magnus Hagander 2011-06-14 19:49:32 Re: perltidy