is `[services.concurrency]` set per service, i.e. protocol & port?

I’m running an IPFS node on Fly.io which listens for p2p connection on both TCP and UDP port 4001.

Do I need to specify the [services.concurrency] section for each one. I currently have it set as follows in the fly.toml

[[services]]
  http_checks = []
  internal_port = 8080
  protocol = "tcp"
  script_checks = []

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["http", "tls"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

  
[[services]]
  internal_port = 4001
  protocol = "tcp"

  [[services.ports]]
    port = 4001

  [services.concurrency]
    type = "connections"
    hard_limit = 1000

[[services]]
  internal_port = 4001
  protocol = "udp"

  [[services.ports]]
    port = 4001
  [services.concurrency]
    type = "connections"
    hard_limit = 1000

Does this make sense? Or is setting it once enough?

1 Like

Have to set concurrency once for each [[services]] section, I’d reckon. That’s what I do (ref).

I’m curious whether just once or just once per protocol (tcp / udp) is enough?

Once per [[services]] section.

You can see how they get organized in our backend with fly config display.

1 Like