Forum OpenACS Q&A: postgresql startup script

Collapse
Posted by Matthew Terenzio on
Am I correct in thinking the startup script for postgres in the Installation docs does not pass the -i flag. It looks like my database is up but I can't connect from the web. I can when I start it manually.
Collapse
Posted by David Walker on
Look in your postgresql.conf file for the tcpip_socket setting
tcpip_socket = true
Collapse
Posted by Lachlan Myers on
As far as I can see, the startup script doesn't have the option.

I believe that if you need to pass it then use

pg_ctl -o "-i"  ..... (your other startup stuff) 

as pg_ctl doesn't pass this directly. The -o passes options to postgres/postmaster.

I don't believe the option is needed for a standard AOLserver /Open ACS on the same machine. I came across it when setting up a ODBC connection.

BTW has anyone composed a PostgreSQL/ daemontools startup process that integrates with the AOLserver/Daemontools startup (love that HOWTO)?

Collapse
Posted by Jon Griffin on

#!/bin/sh
exec 2>&1
exec setuidgid postgres /opt/pgsql/bin/postmaster -D /opt/pgsql/data -B 256 -N 128 -i
Collapse
Posted by Jeff Davis on
Jon, isn't that an awfully small number for -B?

I have been trying to figure out to tune postgres and the only rule of thumb I have seen for -B is to give it 1/4 of physical memory (or 16384 8k buffers for 512mb of memory).

Collapse
Posted by Jon Griffin on
-B is short for shared buffers which I assumed were not the same as cache buffers. It is sort of related to max connections. I only raised it from the default because I have my PG server as a backend to some other servers and I ran out of connections.

It works fine for me, but coming from Oracle I could be completly wrong.

Collapse
Posted by Jeff Davis on
I think the -B flag is in fact the cache buffer. Here is an article by Bruce Momjian which is where I got that.

Anyway, there don't seem to be anywhere near as many knobs to turn on postgresql as on oracle but sadly even less guidance about how to turn those knobs that there is on oracle. Roberto also pointed me at this tuning article but I am not so sure about it since one thing he does is set fsync=false with no real discussion of the consequences.

Collapse
Posted by mark dalrymple on
If folks have money to spend, Bruce Momjian is doing a hard core Postgresql class in conjunction with the Big Nerd Ranch folks. (Disclaimer, I teach a mac programming class for the Big Nerd Ranch)