Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many clients #36

Open
philippeauriach opened this issue Aug 29, 2017 · 0 comments
Open

Too many clients #36

philippeauriach opened this issue Aug 29, 2017 · 0 comments

Comments

@philippeauriach
Copy link

The lib works fine at startup, but after a few map movments, I get the following error :

sorry, too many clients already
server/node_modules/tilesplash/lib/index.js:236:50

When I check the max_connections of my pg database, it is set to 100. I tried to reduce the poolSize of db to 20 or so, but it does not seem to be taken into account. If I wait a little (like 30 seconds or so), the connections are terminated and the server is able to make some calls again, but then after a few moves the error pops back. If I kill and restart the server, it seems to clear the queue.

Did this happened to anyone ?

philippeauriach added a commit to philippeauriach/tilesplash that referenced this issue Sep 13, 2017
Currently, a pg pool was created for each request : this is bad, as each pool keeps a connection to the db so it can reuse it. This caused issue faradayio#36 for me. 
By following the example here : https://github.com/brianc/node-postgres/tree/v6.4.1 the pool must be created only once, and reused across requests (that's the purpose of a pool).
This was referenced Sep 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant