Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 206820 - dev-db/postgresql default conf.d should not override max_connections and shared_buffers
Summary: dev-db/postgresql default conf.d should not override max_connections and shar...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-21 00:29 UTC by Marti Raudsepp
Modified: 2008-06-07 20:36 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to dev-db/postgresql/files/postgresql.conf-8.2 (postgresql.conf-8.2.patch,524 bytes, patch)
2008-01-21 01:03 UTC, Marti Raudsepp
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marti Raudsepp 2008-01-21 00:29:02 UTC
Currently the postgresql-8.2.6 ebuild installs an /etc/conf.d/postgresql file, that specifies:
  PGOPTS="-N 40 -B 80"
which effectively overrides the num_connections parameter from postgresql.conf to 40, and the shared_buffers value to 640 kbytes.

This is bad for several reasons:
1) Users who are already familiar with PostgreSQL expect the values in postgresql.conf to have effect; in particular, the max_connections value is set to 100 by default, and users will be unpleasantly surprised when their installation exceeds 40 concurrent connections and starts failing.

2) The default value of 640 kbytes is the bare minimum for 40 concurrent connections; according to PostgreSQL documentation [1] "However, settings significantly higher than the minimum are usually needed for good performance. Several tens of megabytes are recommended for production installations."

3) PostgreSQL's initdb command (which is invoked by emerge --configure) already sets shared_buffers to a sane value depending on the running kernel. [1]

[1] http://www.postgresql.org/docs/8.2/interactive/runtime-config-resource.html
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2008-01-21 00:45:47 UTC
Changing this will breaks *BSD, see Bug 189141. 
Comment 2 Marti Raudsepp 2008-01-21 00:59:46 UTC
(In reply to comment #1)
> Changing this will breaks *BSD, see Bug 189141.

As far as I can tell, bug 189141 was actually *caused* because Gentoo overrides the values set in the postgresql.conf file. If the conf.d script hadn't explicitly set the -N value, PostgreSQL would have used the one determined by initdb for that particular system.

The documentation states: "The default is typically 100 connections, but may be less if your kernel settings will not support it (as determined during initdb)."

http://www.postgresql.org/docs/8.2/interactive/runtime-config-connection.html#GUC-MAX-CONNECTIONS
Comment 3 Marti Raudsepp 2008-01-21 01:03:17 UTC
Created attachment 141423 [details, diff]
Patch to dev-db/postgresql/files/postgresql.conf-8.2

Maybe I wasn't being clear enough; What I meant was, I would like to see PGOPTS value unset by default altogether.
Comment 4 Tiziano Müller (RETIRED) gentoo-dev 2008-06-07 20:36:28 UTC
We don't do that again in dev-db/postgresql-server