pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PG versus FreeBSD, startup and connections problems
3+ messages / 2 participants
[nested] [flat]

* PG versus FreeBSD, startup and connections problems
@ 2005-01-25 18:19 Mitch Pirtle <mitch.pirtle@gmail.com>
  2005-01-25 21:08 ` Re: PG versus FreeBSD, startup and connections problems Mark Kirkwood <markir@coretech.co.nz>
  0 siblings, 1 reply; 3+ messages in thread

From: Mitch Pirtle @ 2005-01-25 18:19 UTC (permalink / raw)
  To: pgsql-performance

Hi gang,

I just inherited a FreeBSD box, and it is horribly sick. So we moved
everything to a new machine (power supply failures) and finally got
stuff running again.

Ok, for two days (rimshot)

Here are the two problems, and for the life of me I cannot find any
documentation on either:

1) freebsd will only let PostgreSQL have 38 connections at a time,
regardless of kernel settings or postgresql.conf settings. Where
exactly (and how, exactly) does one remedy that problem?

2) As of this morning, the machine was down again, this time apache
fired up normally but pg refuses to start - without errors. When I
start with postmaster on the CLI I also get no errors, just no
postmaster. Why am I not seeing the errors, is this a FreeBSD or
PostgreSQL issue?

For example:

$ pg_ctl start
postmaster successfully started
$ pg_ctl status
pg_ctl: postmaster or postgres not running

OR:

$ postmaster -D /usr/local/pgsql/data
$
(no response)

There are no errors in /var/log/pgsql either, so I have absolutely no
idea how to troubleshoot :-(

-- Mitch



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: PG versus FreeBSD, startup and connections problems
  2005-01-25 18:19 PG versus FreeBSD, startup and connections problems Mitch Pirtle <mitch.pirtle@gmail.com>
@ 2005-01-25 21:08 ` Mark Kirkwood <markir@coretech.co.nz>
  2005-01-26 19:24   ` Re: PG versus FreeBSD, startup and connections problems Mitch Pirtle <mitch.pirtle@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Mark Kirkwood @ 2005-01-25 21:08 UTC (permalink / raw)
  To: Mitch Pirtle <mitch.pirtle@gmail.com>; +Cc: pgsql-performance



Mitch Pirtle wrote:

>1) freebsd will only let PostgreSQL have 38 connections at a time,
>regardless of kernel settings or postgresql.conf settings. Where
>exactly (and how, exactly) does one remedy that problem?
>
>  
>
What version of FreeBSD is the box running?
Generally you need to change semaphores and shared memory settings, e.g. 
for 5.x or late 4.x :

in /etc/sysctl.conf :
kern.ipc.shmmax=100000000
kern.ipc.shmall=32768
(can be set online using systcl -w)

Semaphores need to be set in /boot/loader.conf
kern.ipc.semmni=256
kern.ipc.semmns=256
(can typed at the loader prompt using set)

These settings should let you have ~100 connections and use about 100M 
of shared memory for shared_buffers.

Early 4.x (I think)  and before will need a kernel rebuild, see  
http://www.postgresql.org/docs/7.4/static/kernel-resources.html#SYSVIPC

>2) As of this morning, the machine was down again, this time apache
>fired up normally but pg refuses to start - without errors. When I
>start with postmaster on the CLI I also get no errors, just no
>postmaster. Why am I not seeing the errors, is this a FreeBSD or
>PostgreSQL issue?
>
>For example:
>
>$ pg_ctl start
>postmaster successfully started
>$ pg_ctl status
>pg_ctl: postmaster or postgres not running
>
>OR:
>
>$ postmaster -D /usr/local/pgsql/data
>$
>(no response)
>
>  
>
BTW - What version of Pg are you using?
Check your postgresql.conf to see if all the output is going to syslog, e.g,
syslog=2
If not, then unfortunately it is possible that whatever is causing the 
machine to be unstable has corrupted the data directory (so ...err... 
restore time). Starting the postmaster in debug mode will provide more 
output:
$ postmaster -d 5
Additionally utilitites like 'strace' will give you a bit more info 
about where the startup process gets to.

Do you know why the box went down? The freebsd-bugs or freebsd-stable 
list will help with respect to Freebsd crashing, see 
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/eresources.html#ERESOURCES-MAIL

regards

Mark






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: PG versus FreeBSD, startup and connections problems
  2005-01-25 18:19 PG versus FreeBSD, startup and connections problems Mitch Pirtle <mitch.pirtle@gmail.com>
  2005-01-25 21:08 ` Re: PG versus FreeBSD, startup and connections problems Mark Kirkwood <markir@coretech.co.nz>
@ 2005-01-26 19:24   ` Mitch Pirtle <mitch.pirtle@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Mitch Pirtle @ 2005-01-26 19:24 UTC (permalink / raw)
  To: pgsql-performance

Just a quick shout-out to Mark, as you provided the winning answer. I
found numerous mailing list discussions and web pages, but all were
either fragmented or out of date.

Again, many thanks!

-- Mitch

On Wed, 26 Jan 2005 10:08:58 +1300, Mark Kirkwood <markir@coretech.co.nz> wrote:
> 
> in /etc/sysctl.conf :
> kern.ipc.shmmax=100000000
> kern.ipc.shmall=32768
> (can be set online using systcl -w)
> 
> Semaphores need to be set in /boot/loader.conf
> kern.ipc.semmni=256
> kern.ipc.semmns=256
> (can typed at the loader prompt using set)
> 
> These settings should let you have ~100 connections and use about 100M
> of shared memory for shared_buffers.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-01-26 19:24 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-25 18:19 PG versus FreeBSD, startup and connections problems Mitch Pirtle <mitch.pirtle@gmail.com>
2005-01-25 21:08 ` Mark Kirkwood <markir@coretech.co.nz>
2005-01-26 19:24   ` Mitch Pirtle <mitch.pirtle@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox