PGError: server closed the connection unexpectedly - Mailing list pgsql-general

From Dave Steinberg
Subject PGError: server closed the connection unexpectedly
Date
Msg-id 43C028A7.9090203@redterror.net
Whole thread Raw
List pgsql-general
Hello list,

I've been working a bit today to resolve the error I'm seeing mentioned
in the title, and I was hoping you might have some insight.  I've
managed to semi-reliably reproduce this based on two different tasks:

- a pg_dumpall from my backup server will throw this, but not always on
the same database.  Sometimes it seems to get 'stuck' on one, but later
if I try it again it'll throw the error on a different DB.  The
pg_dumpall appears to work perfectly when run locally.

- A unit test for a Rails app I'm developing will consistently throw
this error, though oddly I can run the problem statement in psql, over
the network, without problem.

My biggest problem is the lack of any real error message on the server.
    I don't see anything wrong in the system logs, and there's no core
file in the /var/postgresql directory.  I did a 'vacuumdb -afz' just as
a shot in the dark, without affect.  Pretty much all I see in the logs
is this:

<USER%DB x.y.z.a(51478) 487>LOG:  unexpected EOF on client connection

Googling turned up a few reports suggesting bad hardware, or corrupted
indexes, but I don't think that's the case here.

Any starting points or ideas would be greatly appreciated.

Basic server info:
- Less than 3 months old
- OpenBSD 3.8, patched fully, x86 w/ a P4
- 2G of Ram, ~1.5G free usually
- /var/postgresql partition has about 8G free, and is backed by a AMI
hardware raid-1 array.
- PostgreSQL version 8.0.3 on server and clients, built locally from
OpenBSD ports
- ruby-postgres adapter version 0.7.1 used in the rails project

Special OS Config bits:

- kern.seminfo sysctl tree:
kern.seminfo.semmni=256
kern.seminfo.semmns=2048
kern.seminfo.semmnu=30
kern.seminfo.semmsl=60
kern.seminfo.semopm=100
kern.seminfo.semume=10
kern.seminfo.semusz=100
kern.seminfo.semvmx=32767
kern.seminfo.semaem=16384

- Bits from _postgresql's ulimit:
$ ulimit -a
time(cpu-seconds)    unlimited
file(blocks)         unlimited
coredump(blocks)     unlimited
data(kbytes)         1048576
stack(kbytes)        8192
lockedmem(kbytes)    635424
memory(kbytes)       1905136
nofiles(descriptors) 768
processes            532

- postgresql.conf changes:
max_connections = 200
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'
log_duration = true
stats_start_collector = true
stats_command_string = false
stats_block_level = false
stats_row_level = false

Thanks in advance!
--
Dave Steinberg
http://www.geekisp.com/
http://www.steinbergcomputing.com/

pgsql-general by date:

Previous
From: Michael Trausch
Date:
Subject: Re: (Select *) vs. (Select id) from table.
Next
From: Jerome Lyles
Date:
Subject: Re: Suse Linux 10.0