How to make one machine in the application?

Why are two machines created in the application by default? They do the same.
I take data from the database and it turns out that two machines take the same document and duplicate handling.

How can I make only one machine in the application?

My fly.toml

app = “api-app”
primary_region = “lax”


PORT = “8080”

internal_port = 8080
auto_stop_machines = false

cpu_kind = “shared”
cpus = 1
memory_mb = 256

Before you deploy? Use --ha=false on deploy.

After deploy? Delete the machine you don’t want with fly machine destroy. fly deploy will only create new machine(s) if you don’t already have any.

1 Like

After deploy. It is inconvenient to delete the machine after each deploy. Why not make an option where you can specify - create 1 machine.

fly deploy should only create machine(s) if you have ZERO currently running machines. If you have one, it should update that one without creating a second one. Are you seeing different results?

I destroyed one machine, deployed the app, have one machine. Thank you, that’s what I wanted.

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