ferristseng / rust-ipfs-api

IPFS HTTP client in Rust
Apache License 2.0
246 stars 68 forks source link

Connection Pooling is Disabled by Default for the Hyper Implementation #132

Closed mrd0ll4r closed 12 months ago

mrd0ll4r commented 1 year ago

Hello,

by default, the hyper backend disables connection pooling here. This is suboptimal for two reasons:

  1. Performance: Performing multiple requests with the same client will open a new connection for each request, which is slow and wasteful.
  2. Long-running programs using the same client with many requests exhaust the port space of the host. This manifests in errors like this
    hyper client error `error trying to connect: tcp connect error: Cannot assign requested address (os error 99)`

Alternatively, I'm looking at using the actix client, but it's not obvious how to enable rustls here.

xianyu11111 commented 1 month ago

请问怎么初始化启动?