I have a sails web app in an intranet environment. An average of ~12 users are logged in at the same time. Eventually I get the classic connection refused message from sails-postgresql
that lasts for at least 3 minutes, denying all http requests made to the app.
Error creating a connection to Postgresql using the following settings:
{
...
schema: true,
ssl: false,
adapter: 'sails-postgresql',
poolSize: 50
...
}
I either get { [Error: write ECONNRESET] code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'write' }
or { [Error: write ECONNRESET] code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }
.
My PostgreSQL logs the following message: No connection could be made because the target machine actively refused it.
As you can see, my poolSize
in sails.config.connections
is set to 50 and my max_connections
in postgresql.conf
is set to 100. I'm not using this database for something else.
Is my poolsize set ok? Is it a problem from Sails or is it Postgres'?