Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix for issue #3: refactoring of connection pool handing #4
These changes fix the connection pool handling issues in
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.