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

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

Merged
merged 2 commits into from Oct 5, 2015

Conversation

Projects
None yet
3 participants
@obscurerichard
Contributor

obscurerichard commented Sep 14, 2015

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

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

This comment has been minimized.

Show comment
Hide comment
@haysclark

haysclark commented Sep 30, 2015

@obscurerichard Great work!

@mjhea0

This comment has been minimized.

Show comment
Hide comment
@mjhea0

mjhea0 Oct 5, 2015

Owner

👍 Thanks so much!

Owner

mjhea0 commented Oct 5, 2015

👍 Thanks so much!

mjhea0 added a commit that referenced this pull request Oct 5, 2015

Merge pull request #4 from obscurerichard/pg-fixes
Fix for issue #3: refactoring of connection pool handing

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

@obscurerichard

This comment has been minimized.

Show comment
Hide comment
@obscurerichard

obscurerichard Oct 16, 2015

Contributor

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

Contributor

obscurerichard commented Oct 16, 2015

@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