You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's unclear from the documentation how to properly re-use connections. There are only sporadic comments and it seems there are multiple settings keepAlive with keepAliveMSecs and/or forever.
We have created a Twilio instance with the following but our APM is still showing every request opening a new tcp connection and querying DNS so the connections are not being reused.
ClientOpts has no way to pass in keepAlive settings so we have to instead pass in the httpClient.
This code executes before axios/http.Agent has a chance to set the Connection header. So it will always set Connection: keep-alive if forever is true or set Connection: close if forever is false.
This means the http.Agent keep alive settings end up being ignored. The correct course of action here is probably to remove the else block and let the underlying client (axios) handle the connection header when it is not being explicitly set by the forever setting.
Issue Summary
It's unclear from the documentation how to properly re-use connections. There are only sporadic comments and it seems there are multiple settings
keepAlive
withkeepAliveMSecs
and/orforever
.We have created a Twilio instance with the following but our APM is still showing every request opening a new tcp connection and querying DNS so the connections are not being reused.
ClientOpts
has no way to pass inkeepAlive
settings so we have to instead pass in the httpClient.We have also found the forever option in
RequestOptions
.Does this end up overriding the RequestClients keepAlive settings? It's also not clear where this can be passed in?
Looking for an example of how to properly pool connections.
Technical details:
The text was updated successfully, but these errors were encountered: