DHT connections limit

Hello, everyone!
I’m doing some experiments with IPFS on mobile. Generally, it works without too much customization. But, as I’ve written here, there are problems with connections count. After some investigation, I’ve found the LowWater and HighWater parameters of connection manager, and they helped a lot. But, there’s still one problem: interaction with DHT. Every time, my node needs to download file, it starts DHT query, and it significantly boost connections count. I’ve been searching a lot for some parameters, that can help me limit connections count during interaction with DHT, but unfortunately, I didn’t manage to find them. Maybe someone can help me and point to some places I may have missed.
Thank anyone for help.

EDIT: Using DHT client as routing didn’t help. I’ve tried to use nil routing, and it helps. But it totally disables dht, which is unpreferred.

Unfortunately, that’s just a problem with DHTs. We need to make a bunch of connections to search through the DHT to find the value we’re looking for.

However, this can be improved in two ways:

  1. Relays (see https://github.com/ipfs/go-ipfs/issues/4197).
  2. Packet protocols (connectionless). This may take a while.
  3. Delegated routing (https://github.com/libp2p/js-libp2p/issues/120). js-ipfs is adding this and go may follow.

Unfortunately, there isn’t currently a good workaround.


Thanks for response!