Supporting huge pages on Windows

From: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Supporting huge pages on Windows
Date: 2016-09-26 02:45:47
Message-ID: 0A3221C70F24FB45833433255569204D1F5F1751@G01JPEXMBYT05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

The attached patch implements huge_pages on Windows. I'll add this to the CommitFest.

The performance improvement was about 2% with the following select-only pgbench. The scaling factor is 200, where the database size is roughly 3GB. I ran the benchmark on my Windows 10 PC with 6 CPU cores and 16GB of RAM.

  pgbench -c18 -j6 -T60 -S bench

Before running pgbench, I used pg_prewarm to cache all pgbench tables and indexes (excluding the history table) in the 4GB shared buffers. The averages of running pgbench three times are:

huge_pages=off: 70412 tps
huge_pages=on : 72100 tps

The purpose of pg_ctl.c modification is to retain "Lock pages in memory" Windows user right in postgres. That user right is necessary for the large-page support. The current pg_ctl removes all privileges when spawning postgres, which is overkill. The system administrator should be able to assign appropriate privileges to the PostgreSQL service account.

Credit: This patch is based on Thomas Munro's one.

Regards
Takayuki Tsunakawa

Attachment Content-Type Size
win_large_page.patch application/octet-stream 7.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2016-09-26 03:24:57 Re: Possibly too stringent Assert() in b-tree code
Previous Message Tsunakawa, Takayuki 2016-09-26 02:37:15 Re: [RFC] Change the default of update_process_title to off