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

connect / release on high frequency endpoints #21

Closed
dbauszus-glx opened this issue Jun 13, 2018 · 1 comment
Closed

connect / release on high frequency endpoints #21

dbauszus-glx opened this issue Jun 13, 2018 · 1 comment

Comments

@dbauszus-glx
Copy link

I am writing a web mapping framework which uses fastify-postgres in many of the data endpoints. Certain endpoints are hit very frequently (hundreds of times from a single user).

Would you recommend to connect, query and release?

Or would you recommend to connect and store the connection in a global and then just query, query, query.

Both methods are working fine for me but I am concerned the connect handshake is taking time while with the always connected solution I am worried what happens if a connection errs.

@mcollina
Copy link
Member

Fastify-postgres initialize a connection pool, calling connect() is fine.

@mcollina mcollina closed this as completed Sep 6, 2018
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

2 participants