Patch für MAP_HUGETLB for mmap() shared memory

From: Christian Kruse <cjk+postgres(at)defunct(dot)ch>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Patch für MAP_HUGETLB for mmap() shared memory
Date: 2012-10-29 20:14:24
Message-ID: 14379474.GK9nBbsGO3@achilles.local.defunct.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hey,

this is my first post to the -hackers lists, so be merciful ;-)

I created a patch which implements MAP_HUGETLB for sysv shared memory segments
(PGSharedMemoryCreate). It is based on tests of Tom Lane and Andres Freund, I
added error handling, huge page size detection and a GUC variable.

Performance improvements differ from about 1% in the worst case to about 13% in
the best case. Benchmarking results are as follows:

pgbench -i -s 100 test

Patched:
pgbench -n -S -j 64 -c 64 -T 10 -M prepared test
tps avg: 51879.2

Unpatched:
pgbench -n -S -j 64 -c 64 -T 10 -M prepared test
tps avg: 45321.6

tps increase: 6557.6, 12.6%

Patched:
pgbench -n -S -j 64 -c 64 -T 180 -M prepared test (patched)

number of transactions actually processed: 8767510
tps = 48705.159196 (including connections establishing)
tps = 48749.761241 (excluding connections establishing)

Unpatched:
mit pgbench -n -S -j 64 -c 64 -T 120 -M prepared test (unpatched)

number of transactions actually processed: 8295439
tps = 46083.559187 (including connections establishing)
tps = 46097.763939 (excluding connections establishing)

tps diff: 2652, 5%

create table large (a int, b int);
insert into large (a, b) select s, s + 10 from generate_series(1, 10000000) s;

5 times executed, with \timing on:
SELECT sum(a), sum(b) from large;
Time: 1143.880 ms unpatched
Time: 1125.644 ms patched
about 1% difference

The patch ist attached. Any comments?

Greetings,
CK

Attachment Content-Type Size
huge_tlb.patch text/x-patch 9.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2012-10-29 20:31:13 Re: WIP checksums patch
Previous Message Jim Nasby 2012-10-29 20:10:31 Re: Deparsing DDL command strings