Thread: Connect Failed error

Connect Failed error

From
"vijayendra mohan agrawal"
Date:
Hi all,
 
I have developed an application using PostGreSQL in the backend. The application is to simulate some Network elements which should communicate with some other application (Which is actually a Black Box for us). There is always one instance of that application with each instance of Network Element I simulate in my application.
 
That application will send different type of requests to my application, and my application will respond to those requests by querying to the database. The frequency of such requests are very high (maybe 4-5 requests per second). Each request will be serviced in a "separate thread".
 
My interface to the database is executeQuery() and executeUpdate() type. The connection object is local to the implementation of executeQuery() and executeUpdate(). The connection object is made local to avoid synchronization problems. (I am using C language). These methods are connecting to database each time they are being called, and then after finishing query, they close the database connection.
 
I am using PQsetdb() for connecting to the database and PQfinish(DatabaseConnection db) to close database connection.
 
The application runs fine with as many as 50 instances of Network Elements with a very high rate of message coming from 50 corresponding "Black Box applications". But it will stop after some hours of continous run (max 16 hours). error :
"Connection to database failed"
 
I want the application to run forever. Please tell me what to do.
 
Platform : HP-UX 11.0
Language : C, Motif X-Windows Programming
Database : PostGreSQL 7.0.2
 
Thanks,
Vijay

Re: Connect Failed error

From
Tom Lane
Date:
"vijayendra mohan agrawal" <vijayendra.agrawal@wipro.com> writes:
> The application runs fine with as many as 50 instances of Network Elements
> with a very high rate of message coming from 50 corresponding "Black Box
> applications". But it will stop after some hours of continous run (max 16
> hours). error :
> "Connection to database failed"

This isn't enough info to troubleshoot your problem.  *Why* is that
error coming out?  If your application isn't willing to provide more
info, try looking in the postmaster's stdout/stderr log for error
messages.  (You are keeping such a log, I hope, and not using -S or
sending the messages to /dev/null.)

            regards, tom lane

RE: Connect Failed error

From
"vijayendra mohan agrawal"
Date:
Hi,

I am getting the following errors :
FATAL 1:  Memory exhausted in AllocSetAlloc()
pq_recvbuf: unexpected EOF on client connection

or sometimes...
pq_flush: send() failed: Broken pipe

For ending a connection, I am using PQfinish(database_connection con)

Any inform will be helpfull...

Vijay

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Tuesday, January 09, 2001 11:23 PM
To: vijayendra.agrawal@wipro.com
Cc: PostGre SQL Mailing List
Subject: Re: Connect Failed error


"vijayendra mohan agrawal" <vijayendra.agrawal@wipro.com> writes:
> The application runs fine with as many as 50 instances of Network Elements
> with a very high rate of message coming from 50 corresponding "Black Box
> applications". But it will stop after some hours of continous run (max 16
> hours). error :
> "Connection to database failed"

This isn't enough info to troubleshoot your problem.  *Why* is that
error coming out?  If your application isn't willing to provide more
info, try looking in the postmaster's stdout/stderr log for error
messages.  (You are keeping such a log, I hope, and not using -S or
sending the messages to /dev/null.)

            regards, tom lane