We have a
* PG 8.4 server
* 16GB RAM
* 16 CPU cores
* Linux Centos 5 (2.6.18-406.el5.centos.plus kernel)
* max_connections: 800 (but never over 500. usually 300 to 400)
WE have detected randomly slow connections when accessing through the network (not at localhost)
We use a script with a loop calling the psql command running a simple "select 1 from table".
At localhost, the conection is a flash, showing in very few ms the result on screen.
When passing the parameter "-h" with its own IP addres it begin answering immediately, but suddenly it has a delay of 10 seconds or more to answer on 1 or 2 of 10 commands.
Our suspect is that ther is a problem with the network stack parameter, perhaps at kernel level.
May it be the truth?