-
Notifications
You must be signed in to change notification settings - Fork 28
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
Re-use http connection? #417
Comments
I just changed my bee.downloadData invocation with an axios call using the keepAlive httpAgent and the TIME_WAIT sockets disappeared. That seems to prove that bee-js is not reusing connections but is getting a new socket for each request. |
Interesting stuff! Btw. we have released |
Once I get my testnet nodes restabilized on the upcoming release, I'll get back to working on the stewardship stuff. I do it all from node.js, which I think also now uses ky/fetch from when I glanced at the source when opening this issue. |
Release v8.3.0 addresses this. |
I've got a node.js script that uses bee-js's bee.downloadData extensively along with axios for /stewardship (until the pinning requirement is removed from bee-js). I noticed when running against a bee node on Windows, that there were 1,000s of sockets in a TIME_WAIT state indicating that multiple connections were being made to the bee node in a short span of time.
I researched how to get axios to reuse a single http connection and found this in their readme.md:
Upon adding that to my script, I found the number of TIME_WAIT sockets was cut in half. This indicates to me that bee-js must also not be reusing an existing http connection but is establishing a new one for each request.
Is there a way to change this behavior in bee-js in the interest of performance?
The text was updated successfully, but these errors were encountered: