[RFC] Change the default of update_process_title to off

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: [RFC] Change the default of update_process_title to off
Date: 2016-08-04 07:41:48
Message-ID: 0A3221C70F24FB45833433255569204D1F5BE3E8@G01JPEXMBYT05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I'd like to propose changing the default value of update_process_title to off, at least on Windows. I'll submit a patch if we see no big problem.

PROBLEM
========================================

Our customer is trying to certify PostgreSQL with their packaged software product. Currently, the product supports a famous DBMS (let me call it DBMS-X hereafter). They evaluated the performance of PostgreSQL and DBMS-X.

The performance of PostgreSQL was very bad on Windows. The result was as follows (the unit is some request throughput). These were measured on the same machine.

* DBMS-X on Windows: 750
* PostgreSQL on Windows: 250
* PostgreSQL on Linux: 870

The performance on Windows was considered unacceptable. Using pgbench, we could see similar result -- the performance on Linux is about three times higher than on Windows.

CAUSE
========================================

The CreateEvent() and CloseHandle() Win32 API calls from postgres.exe was consuming much CPU time. While stressing the system by running the select-only mode of pgbench, Windows performance monitor showed 50% User Time, 40% Privileged Time, and 10% Idle Time. Windows Performance Toolkit, which corresponds to perf on Linux, revealed that half of the privileged time was used by CreateEvent() and CloseHandle() called from set_ps_display(). Those calls are performed when update_process_title is on.

With update_process_title off, the performance became much closer to Linux as follows. The scaling factoris 300. The pgbench client was run on a different Windows machine with 12 CPU cores. The effect was minimal on Linux.

C:\> pgbench -h <db_server> -T 30 -c #clients -j 12 -S benchdb

[Windows]
#clients on off
12 29793 38169
24 31587 87237
48 32588 83335
96 34261 67668

[Linux]
#clients on off
12 52823 52976
24 90712 91955
48 108653 108762
96 107167 107140

PROPOSAL AND CONSIDERATIONS
========================================

I think we should change the default of update_process_title to off on Windows because:

1. The performance gain is huge.
2. It's almost useless because we can only see the postgres command line with Process Explorer, which the user must download from Microsoft and install.
3. I don't see the benefit of update_process_title=on at the expense of performance.
4. The default setting of PostgreSQL parameters should be friendly. I'm afraid many users cannot track the cause of poor performance to update_process_title. I heard that MySQL's popularity was partly because it ran smoothly on Windows in the early days. PostgreSQL should be, too.

The question is, do we want to change the default to off on other OSes? Is the command line really useful? If useful, does it need to be on by default?

Regards
Takayuki Tsunakawa

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2016-08-04 07:42:31 Re: New version numbering practices
Previous Message Michael Paquier 2016-08-04 07:38:40 Re: [sqlsmith] FailedAssertion("!(XLogCtl->Insert.exclusiveBackup)", File: "xlog.c", Line: 10200)