[RFC] Change the default of update_process_title to off - Mailing list pgsql-hackers

From Tsunakawa, Takayuki
Subject [RFC] Change the default of update_process_title to off
Date
Msg-id 0A3221C70F24FB45833433255569204D1F5BE3E8@G01JPEXMBYT05
Whole thread Raw
Responses Re: [RFC] Change the default of update_process_title to off  (Michael Paquier <michael.paquier@gmail.com>)
List 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
patchif we see no big problem.
 


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

Our customer is trying to certify PostgreSQL with their packaged software product.  Currently, the product supports a
famousDBMS (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
onLinux 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
systemby 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
privilegedtime was used by CreateEvent() and CloseHandle() called from set_ps_display().  Those calls are performed
whenupdate_process_title is on.
 

With update_process_title off, the performance became much closer to Linux as follows.  The scaling factoris 300.  The
pgbenchclient 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
downloadfrom 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
poorperformance to update_process_title.  I heard that MySQL's popularity was partly because it ran smoothly on Windows
inthe 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,
doesit need to be on by default?
 

Regards
Takayuki Tsunakawa





pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [sqlsmith] FailedAssertion("!(XLogCtl->Insert.exclusiveBackup)", File: "xlog.c", Line: 10200)
Next
From: Craig Ringer
Date:
Subject: Re: New version numbering practices