Time to read pg_hba.conf (Re: [PATCHES] [PATCH] Patch to make...)

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Time to read pg_hba.conf (Re: [PATCHES] [PATCH] Patch to make...)
Date: 2001-07-10 19:47:47
Message-ID: Pine.LNX.4.30.0107102110540.677-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane writes:

> Since pg_hba.conf is re-read on every connection, I've always thought
> it was pretty bogus to bulk it up with that much internal documentation.
> I've not tried to measure how much time it takes the postmaster to skip
> over those 200 comment lines, but it can't be completely negligible.

I've run a simplistic test for this. I've let psql start 10000 times
sequentially and timed the backend startup. All times are wall clock
(gettimeofday). The first checkpoint is after the accept(), the second
before the backend loop begins. The machine had a load average of 1.00 to
1.50 and wasn't running anything else besides "infrastructure".

default pg_hba.conf

count | min | max | avg | stddev
-------+----------+----------+--------------+---------------------
10000 | 0.024667 | 0.060208 | 0.0298723081 | 0.00746411804719077

pg_hba.conf, all comments removed

count | min | max | avg | stddev
-------+----------+---------+--------------------+---------------------
10000 | 0.022364 | 0.05946 | 0.0262477744000001 | 0.00570493964559965

So we're looking at a possible 12% win. I suggest we remove the comments
and direct the user to the Admin Guide.

Btw., in case someone wants to go optimizing, more than 75% of the backend
startup time is spent in InitPostgres():

count | min | max | avg | stddev
-------+---------+----------+--------------+---------------------
10000 | 0.01953 | 0.368216 | 0.0222271679 | 0.00629838985852663

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Roderick A. Anderson 2001-07-10 20:12:05 Re: Performance tuning for linux, 1GB RAM, dual CPU?
Previous Message Joseph Shraibman 2001-07-10 19:40:12 Re: Re: Backups WAS: 2 gig file size limit

Browse pgsql-patches by date

  From Date Subject
Next Message Jason Tishler 2001-07-10 20:00:54 Re: Python (PyGreSQL) make install patch
Previous Message Joseph Shraibman 2001-07-10 19:45:43 Re: Shutdown hook imp