Обсуждение: Initial max_connections for initdb on FreeBSD.

Поиск
Список
Период
Сортировка

Initial max_connections for initdb on FreeBSD.

От
"Greg Sabino Mullane"
Дата:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


I've got a BSD system I work on that is jailed and has low shared memory
settings. So low that I cannot even initdb to create a test 8.3.1 database.
It tries to create template1 with shared_buffers of 50 and max_connections
of 13. Is there any way to tweak those during initdb? Should there or can
there be? Is there another way around this problem that can be somewhat
automated? For my testing purposes, I don't need high settings at all
(max_connections could be 2, for example).

- --
Greg Sabino Mullane greg@turnstep.com
End Point Corporation
PGP Key: 0x14964AC8 200805291558
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8


-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkg/CuMACgkQvJuQZxSWSsghIgCffg2J6RrI/4us8FhBW929Cabw
U6QAn1kpDl1fryfLMNyikew5g4jU7Rub
=OOus
-----END PGP SIGNATURE-----




Re: Initial max_connections for initdb on FreeBSD.

От
Shane Ambler
Дата:
Greg Sabino Mullane wrote:
> -----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160
> 
> 
> I've got a BSD system I work on that is jailed and has low shared
> memory settings. So low that I cannot even initdb to create a test
> 8.3.1 database. It tries to create template1 with shared_buffers of
> 50 and max_connections of 13. Is there any way to tweak those during
> initdb? Should there or can there be? Is there another way around
> this problem that can be somewhat automated? For my testing purposes,
> I don't need high settings at all (max_connections could be 2, for
> example).
> 
From the manual I get -

initdb uses uses the environment variables supported by libpq

PGOPTIONS sets additional run-time options for the PostgreSQL server

postgres -

-B nbuffers
Sets the number of shared buffers for use by the server processes. The
default value of this parameter is chosen automatically by initdb.
Specifying this option is equivalent to setting the shared_buffers
configuration parameter.

-N max-connections
Sets the maximum number of client connections that this server will
accept. The default value of this parameter is chosen automatically by
initdb. Specifying this option is equivalent to setting the
max_connections configuration parameter.



So I would try something like -

setenv PGOPTIONS -N 2 -B 10  (or export depending on shell)
initdb -D /path/to/data


-- 

Shane Ambler
pgSQL (at) Sheeky (dot) Biz

Get Sheeky @ http://Sheeky.Biz


Re: Initial max_connections for initdb on FreeBSD.

От
Euler Taveira de Oliveira
Дата:
Greg Sabino Mullane wrote:

> there another way around this problem that can be somewhat
> automated?
> 
I don't think so. This is a particular case. So my advice is to hack 
test_config_settings() and add your custom values to trial_conns[] and 
trial_bufs[].


--   Euler Taveira de Oliveira  http://www.timbira.com/


Re: Initial max_connections for initdb on FreeBSD.

От
"Greg Sabino Mullane"
Дата:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


> I don't think so. This is a particular case. So my advice is to hack
> test_config_settings() and add your custom values to trial_conns[] and
> trial_bufs[].

Thanks. I dropped those to their bare minimums (1 and 16), and still did
not have enough memory (!) It also appears that users cannot manipulate their
shmmax setting inside of a FreeBSD jail, so I'll just give up this part of the
quest.

(Shane, the PGOPTIONS stuff does not apply to this case)

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200805301018
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkhADL4ACgkQvJuQZxSWSsj/6QCgqzS3EgTgM0QB+kYsdlHycimp
FuAAn22suYbUfGzDSgPA9M33W12pvuNY
=JxDi
-----END PGP SIGNATURE-----