How do you limit the number of outgoing connections

I have the topologyUpdater running and set MAX_PEERS=4. It generates the following URL with associated response.

$ curl  "https://api.clio.one/htopology/v1/fetch/?max=4&magic=764824073"

{ "resultcode": "201", "networkMagic": "764824073", "ipType":4, "requestedIpVersion":"4", "Producers": [
  { "addr": "207.244.247.126", "port": 7000, "valency": 1, "distance":25,  "continent":"NA",  "country":"US",  "region":"MO" },
  { "addr": "relay-node-02.monkeycontracts.co", "port": 6000, "valency": 1, "distance":636,  "continent":"NA",  "country":"US",  "region":"OH" },
  { "addr": "3.233.113.92", "port": 6000, "valency": 1, "distance":1100,  "continent":"NA",  "country":"US",  "region":"VA" },
  { "addr": "ada-ams.allnodes.me", "port": 3001, "valency": 1, "distance":1399,  "continent":"NA",  "country":"NL",  "region":"NY" },
  { "addr": "75.119.156.249", "port": 6000, "valency": 1, "distance":1653,  "continent":"NA",  "country":"DE",  "region":"FL" },
  { "addr": "173.164.75.189", "port": 2020, "valency": 3, "distance":2753,  "continent":"NA",  "country":"US",  "region":"OR" },
  { "addr": "138.68.153.72", "port": 6000, "valency": 1, "distance":6743,  "continent":"EU",  "country":"GB",  "region":"ENG" },
  { "addr": "relaynode01.cardano.after9pm.org", "port": 6000, "valency": 1, "distance":7038,  "continent":"EU",  "country":"FR",  "region":"IDF" },
  { "addr": "194.163.140.44", "port": 6000, "valency": 1, "distance":7235,  "continent":"EU",  "country":"DE",  "region":"HH" },
  { "addr": "178.18.255.185", "port": 4005, "valency": 1, "distance":7408,  "continent":"EU",  "country":"DE",  "region":"BW" },
  { "addr": "49.12.198.221", "port": 6000, "valency": 1, "distance":7546,  "continent":"EU",  "country":"DE",  "region":"BY" },
  { "addr": "5.189.128.50", "port": 6663, "valency": 1, "distance":7661,  "continent":"EU",  "country":"DE",  "region":"BY" },
  { "addr": "rel02.fairpool.eu", "port": 55002, "valency": 1, "distance":7817,  "continent":"EU",  "country":"AT",  "region":"null" },
  { "addr": "54.168.30.53", "port": 7328, "valency": 1, "distance":10274,  "continent":"AS",  "country":"JP",  "region":"13" },
  { "addr": "relay2.ltespool.com", "port": 6000, "valency": 1, "distance":14560,  "continent":"OC",  "country":"AU",  "region":"NSW" },
  { "addr": "52.74.155.134", "port": 8131, "valency": 1, "distance":15322,  "continent":"AS",  "country":"SG",  "region":"01" }
] }

This isn’t right, is it? How do you control the number of outgoing connections?
I’d like to see how that affects memory consumption.

Ok, but u don’t have custom peers added?

That was quick, they fixed it immediately - merci.

Custom peers are handled locally i.e. we no longer publish the location of the block producer over that API

That’s right, custom peers are locally but are not added tot the total of out peers?

Anyway… I always reduce the number of max peers when I add custom peers to keep the total OUT peers ~ 20

@tomdx curious as to what you found on the memory consumption when altering the MAX_PEERS? Significant impact? I’m sure it did on the bandwidth.

It’s not that much, we run approx 25-30 outbound on relays, pushes it up a couple of gig against a node with 2-3 connections.

1 Like