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