Skip site navigation (1) Skip section navigation (2)

Re: pgbench internal contention

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgbench internal contention
Date: 2011-07-31 01:46:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Sat, Jul 30, 2011 at 9:08 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> If I'm reading the code right, it only modifies __libc_drand48_data on
> first call, so as long as we called erand48() at least once before
> spawning the child threads, it would probably work.  That seems pretty
> fragile in the face of the fact that they explicitly state that
> they're modifying the global random generator state and that you
> should use erand48_r() if you want reentrant behavior.  So I think if
> we're going to go the erand48() route we probably ought to force
> pgbench to always use our version rather than any OS-supplied version.

Attached is a try at that approach.  Performance benefits are similar
to before.  Same test case as in my OP on this thread, alternating
runs without and with this patch:

tps = 199133.418419 (including connections establishing)
real	5m0.017s
user	23m42.170s
sys	18m46.270s

tps = 226202.289151 (including connections establishing)
real	5m0.018s
user	22m7.520s
sys	9m54.570s

tps = 191144.247489 (including connections establishing)
real	5m0.025s
user	23m35.200s
sys	17m19.070s

tps = 226353.187955 (including connections establishing)
real	5m0.017s
user	21m42.300s
sys	10m9.820s

tps = 189602.248908 (including connections establishing)
real	5m0.044s
user	23m24.060s
sys	17m1.050s

tps = 224521.459164 (including connections establishing)
real	5m0.017s
user	22m9.620s
sys	10m22.590s

Robert Haas
The Enterprise PostgreSQL Company

Attachment: pgbench-erand48.patch
Description: application/octet-stream (6.6 KB)

In response to


pgsql-hackers by date

Next:From: Kohei KaiGaiDate: 2011-07-31 06:21:55
Subject: Re: [RFC] Common object property boards
Previous:From: Andrew DunstanDate: 2011-07-31 01:25:58
Subject: Re: Review of VS 2010 support patches

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group