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

Merged
merged 2 commits into from Oct 5, 2015

Projects

None yet

3 participants

@obscurerichard
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.

obscurerichard added some commits Sep 14, 2015
@obscurerichard obscurerichard Fix connection pool problems
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.
56f6a59
@obscurerichard obscurerichard Merge remote-tracking branch 'origin' into pg-fixes a4d5dbd
@haysclark

@obscurerichard Great work!

@mjhea0
Owner
mjhea0 commented Oct 5, 2015

👍 Thanks so much!

@mjhea0 mjhea0 merged commit a550978 into mjhea0:master Oct 5, 2015
@obscurerichard
Contributor

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

@obscurerichard obscurerichard deleted the obscurerichard:pg-fixes branch Oct 16, 2015
@obscurerichard obscurerichard restored the obscurerichard:pg-fixes branch Oct 16, 2015
@obscurerichard obscurerichard deleted the obscurerichard:pg-fixes branch Oct 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment