Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix for issue #3: refactoring of connection pool handing#4

Merged
mjhea0 merged 2 commits intomjhea0:masterfrom
obscurerichard:pg-fixes
Oct 5, 2015
Merged

Fix for issue #3: refactoring of connection pool handing#4
mjhea0 merged 2 commits intomjhea0:masterfrom
obscurerichard:pg-fixes

Conversation

@obscurerichard
Copy link
Contributor

These changes fix the connection pool handling issues in index.js. See issue #3 for more details.

With these fixes in place, the server keeps the connections open that it starts as expected when the load is high.

See these load test results for a validation that this is working.

This builds on pull request #2 and includes all the changes in it.

Use done() instead of client.end()
Move error handling to top of function
Return 500 errors that are JSON encapsulated

This results in a 4x speedup vs. using client.end(),
as when we use the connection pool, we should only call
done() so that the connections get returned. Closing them
is very costly since they will need to be reopened.
@haysclark
Copy link

@obscurerichard Great work!

@mjhea0
Copy link
Owner

mjhea0 commented Oct 5, 2015

👍 Thanks so much!

mjhea0 added a commit that referenced this pull request Oct 5, 2015
Fix for issue #3: refactoring of connection pool handing
@mjhea0 mjhea0 merged commit a550978 into mjhea0:master Oct 5, 2015
@obscurerichard
Copy link
Contributor Author

@haysclark Thanks for the compliment!
@mjhea0 Thank you for merging the pull request!

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

Successfully merging this pull request may close these issues.

3 participants