Re: PATCH: pgbench / int64 instead of int for xact count

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tomas Vondra <tv(at)fuzzy(dot)cz>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PATCH: pgbench / int64 instead of int for xact count
Date: 2014-05-25 17:05:12
Message-ID: 20140525170511.GD18867@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2014-05-25 18:05:03 +0200, Tomas Vondra wrote:
> I've been running a few longer pgbench tests (~week), and I've run into
> this:

> number of transactions actually processed: -1785047856
> latency average: -10.846 ms
> tps = -2950.492090 (including connections establishing)
> tps = -2950.492325 (excluding connections establishing)
>
> The instance was doing ~10k tps for a week, which caused overflow of the
> int counter, used to track number of transactions. Hence the negative
> values.

> I think we've reached the time when hardeare capable of doing this is
> pretty common (SSDs, ...), so I think it's time to switch the counter to
> int64.

Especially when it's perfectly possible to do 500k read only
transactions a second...

> printf("number of transactions per client: %d\n", nxacts);
> - printf("number of transactions actually processed: %d/%d\n",
> + printf("number of transactions actually processed: %ld/%d\n",
> normal_xacts, nxacts * nclients);

That's not right though. On windows a long (indicated by the %l) is only
4 bytes wide. Check INT64_FORMAT. That's generated by configure/platform
template files and should always be correct.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-05-25 17:10:00 Re: Sending out a request for more buildfarm animals?
Previous Message Andres Freund 2014-05-25 17:01:09 Re: pg_recvlogical not accepting -I to specify start LSN position