Scale to zero not working on private app

Hello! I am starting to test fly.io as a candidate for hosting an upcoming product, and so far I’ve really like what I’ve seen.

Yesterday I’ve deployed a SeaweedFS single-node setup on a machine, configured for automatic scaling to zero (see config below), but 12 hours later this hasn’t happened yet. I’m wondering if the health check is somehow interfering with the Fly Proxy stopping machines.

L.E. The app instance is isolated and isn’t called externally by anything except for the health check, and it only has a flycast private IPv6 assigned, no public IPs.

Any help is greatly appreciated!

app = "om-staging-seaweed"
primary_region = "ams"

kill_signal = "SIGINT"
kill_timeout = 120

[build]
  image = "chrislusf/seaweedfs:3.54"

[mounts]
  source="seaweed_data"
  destination="/data"

[[services]]
  protocol = "tcp"
  internal_port = 9333
  auto_start_machines = true
  auto_stop_machines = true
  min_machines_running = 0

[[services]]
  protocol = "tcp"
  internal_port = 8888
  auto_start_machines = true
  auto_stop_machines = true
  min_machines_running = 0

[checks]
  [checks.http_check]
    interval = "30s"
    method = "get"
    path = "/cluster/healthz"
    port = 9333
    timeout = "30s"
    type = "http"

[experimental]
  cmd = ["server", "-filer", "-dir=/data", "-volume.max=0", "-master.volumeSizeLimitMB=1024"]

Hi @devpikachu, it looks like you’re missing the [[services.ports]] sections on your defined services.

2 Likes

Cool! Thanks so much @catflydotio, that fixed the issue and the app was downscaled in no time. Perhaps adding a clarifying note on the docs for auto-start/stop would be useful, as it doesn’t specifically mention that a “public” port mapping is required for the autoscaling to work, unless I missed it.

Thanks for the feedback, @devpikachu. We’ve updated our fly.toml doc to make it clear that services.ports settings are a necessary part of any services configuration in fly.toml.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.