neumino / rethinkdbdash

An advanced Node.js driver for RethinkDB with a connection pool, support for streams etc.
MIT License
848 stars 109 forks source link

Connection Pooling stops after 3-6 pools are created #381

Closed adiologydev closed 6 years ago

adiologydev commented 6 years ago

Hey so I run a Discord Bot and I have about 19 shards which mean 19 processes, I use RethinkDB as my dashboard and when I boot my app, 4-6 of my processes connects with my server without a problem but any further pools just give these massive spam errors:

Fail to create a new connection for the connection pool. Error:{"msg":"Failed to connect to localhost:28015 in less than 20s","message":"Failed to connect to localhost:28015 in less than 20s.","isOperational":true}
Fail to create a new connection for the connection pool. Error:{"msg":"Failed to connect to localhost:28015 in less than 20s","message":"Failed to connect to localhost:28015 in less than 20s.","isOperational":true}
Fail to create a new connection for the connection pool. Error:{"msg":"Failed to connect to localhost:28015 in less than 20s","message":"Failed to connect to localhost:28015 in less than 20s.","isOperational":true}
Fail to create a new connection for the connection pool. Error:{"msg":"Failed to connect to localhost:28015 in less than 20s","message":"Failed to connect to localhost:28015 in less than 20s.","isOperational":true}
Fail to create a new connection for the connection pool. Error:{"msg":"Failed to connect to localhost:28015 in less than 20s","message":"Failed to connect to localhost:28015 in less than 20s.","isOperational":true}
Fail to create a new connection for the connection pool. Error:{"msg":"Failed to connect to localhost:28015 in less than 20s","message":"Failed to connect to localhost:28015 in less than 20s.","isOperational":true}

My connection is default with RehtinkDB Dash, { db: "pengubot" } those are my options. My bot executes about 1,000+ reads at the time of boot per shard, there's a delasy of 5.5seconds between every shard.

Please help me as I can't figure what I can do to optimize it or make it work.