Sans tenir compte du shmmax pour lequel j'ai

postgres@olivia:~$ cat /proc/sys/kernel/shmmax
33554432

Soit shmmax = 33554432 bytes.

Ayant 1 kB = 1024 bytes et 1 MB = 1024kB, j'ai donc shmmax = 33554432/(1024*1024)= 32 MB.

Je suis loin de dépasser ce seuil. D'après la documentation:

D'après http://docs.postgresqlfr.org/8.3/kernel-resources.html, on a donc

PostgreSQL™ utilise un sémaphore par connexion autorisée (max_connections) et par processus autovacuum autorisé (autovacuum_max_workers), le tout par ensemble de 16.

Donc shared_buffers >= (max_connections+autovacuum_max_workers) * 16 kB Comme chez moi autovacuum_max_workers = 3, on aura donc si je mets pour max_connections = 11 donc shared_buffers>=14*16=224

Faisons quelques tentaives:

  1. shared_buffers = 223kB
    postgres@olivia:~$ pg_ctl restart -o "-i -p 5441" -D disk1
    pg_ctl: PID file "disk1/postmaster.pid" does not exist
    Is server running?
    starting server anyway
    postgres: the number of buffers (-B) must be at least twice the number of allowed connections (-N) and at least 16
    server starting
    postgres@olivia:~$ pg_ctl status -o "-i -p 5441" -D disk1
    pg_ctl: no server running
    
    Le serveur ne démarre pas!!!
  2. shared_buffers = 224kB
    postgres@olivia:~$ pg_ctl restart -o "-i -p 5441" -D disk1
    pg_ctl: PID file "disk1/postmaster.pid" does not exist
    Is server running?
    starting server anyway
    server starting
    postgres@olivia:~$ LOG:  database system was shut down at 2009-06-08 23:43:29 CEST
    LOG:  database system is ready to accept connections
    LOG:  autovacuum launcher started
    
    postgres@olivia:~$ pg_ctl status -o "-i -p 5441" -D disk1
    pg_ctl: server is running (PID: 16182)
    /opt/pgsql/bin/postgres "-i" "-p" "5441"
    
    Le serveur démarre