Autostop doesn't work

Hello,

This is the first time I’ve encountered this issue with the auto-stop functionality. All my other apps handle it perfectly fine.

For context, it’s a database that I access using its flycast address (myapp.flycast:port).

It remains constantly running, even without usage. Therefore, the auto-stop feature doesn’t work. However, if I run fly machines stop my-machine-id, it restarts fine when in use, and the health checks run smoothly.

Do you have any suggestions?

For your information, here’s my fly.toml:

app = "myapp"
primary_region = "cdg"
kill_signal = "SIGINT"
kill_timeout = "5s"

[experimental]
  auto_rollback = true

[env]
  PORT = "27017"

[[mounts]]
....some data

[[services]]
  internal_port = 27017
  auto_start_machines = true
  auto_stop_machines = true
  min_machines_running = 0
  processes = ["app"]
  protocol = "tcp"

  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    port = 27017

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

[[vm]]
  cpu_kind = "shared"
  cpus = 2
  memory_mb = 512

Hi… Databases in particular are prone to being kept awake by open connections from client machines, even when there isn’t any query traffic.

You might try looking for those…

$ fly ssh console -a mongodb-app-name
# ss -tn state established '( sport = 27017 )'

(Note that the spaces before and after the parentheses are (weirdly) mandatory.)

On Debian, ss can be found in the iproute2 package.

Hi! Thanks for your answer!

The weird part is that I just recreated an app, identical to an old one, in a new region, and with more disk space. And on the old one, everything was working fine.

Indeed, I had zombie connections that I was able to cut. I will keep an eye on this issue and see if it comes back!

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