0
I ran a test, shut down the server and called the method psycopg2.pool.SimpleConnectionPool
, the method is waiting for a response for a very long time, about a minute, only then it raises the exception OperationalError
.
Is that normal? Is there any way to decrease this waiting time?
>>>import psycopg2, psycopg2.pool
>>> a=psycopg2.pool.SimpleConnectionPool(1, 2, host = 'ip-do-server', user = 'postgres', password = 'postgres', database = 'nomebanco', port = 5432)
Post the code responsible for this routine, so it’s better for the community to help you, I also suggest you do a tour to learn more about the site.
– gato
The code is simple: >>>import psycopg2, psycopg2.pool >>> a=psycopg2.pool.Simpleconnectionpool(1, 2, host = 'ip-do-server', user = 'postgres', password = 'postgres', database = 'basename', port = 5432) . . . Only after almost a minute does the exception come: psycopg2.Operationalerror: could not connect to server: Connection timed out Is the server running on host "192.168.56.2" and Accepting TCP/IP Connections on port 5432?
– Matheus Saraiva
Click the 'edit' button and add the code to the question.
– gato
Follow on ubuntupaste http://paste.ubuntu.com/14597266/
– Matheus Saraiva