How to have one (and only one!) machine running

Hey,
I’ve already read other posts regarding this topic, but I want to double check:

My app is poorly built, but the client isn’t paying for a refactor.
This is a temporary machine for a single event (few hours), and I need to ensure only one machine is running (they didn’t pay for load balancing), otherwise the whole system does not work as expected (internal state, and other poorly built logic).

If I have to change a secret or do vertical scaling, I want the single server to shut down, and restart with the required changes (I guess restart for secret, and kill old machine + new machine for vertical scaling).

Here is my config:

[http_service]
  internal_port = 3000
  force_https = true
  auto_stop_machines = false
  auto_start_machines = false
  min_machines_running = 0
  processes = ['app']

[[vm]]
  # When vertical scaling is needed
  # memory = '32gb'
  # cpu_kind = 'performance'
  # cpus = 16
  size = "shared-cpu-2x"
  memory = "512mb"

Is the config correct?
From what I read, I need to always use --ha=false to ensure that a single machine is used.

In the case of:

  • a new secret: fly secrets set MY_SECRET='new value'
    • How to prevent the rolling update? Afaik this will have 2 machines running during the update.
  • scaling vertically: change the fly.toml, then run fly deploy --ha=false
    • Will this kill the old machine before doing the update? Will I have 2 machines running like a rolling update?

Last time I had to do this kind of updates, it was a mess. Especially the beefy machine was always restarting (I guess I had auto_start_machines to true?).

Thanks for the help :folded_hands:

Hi… No, you might be thinking of bluegreen or canary. (People in the forum do sometimes informally refer to the former as “rolling”, :fish_cake_with_swirl:, and the old Nomad system may have had different definitions and handling back when…)

The real strategy = "rolling" shouldn’t create any new Machines out of thin air.

Perhaps you already had two Machines in existence at the time and didn’t realize it, since prior to the update one had always been stopped?


Aside: You can get more fine-grained control over updates with fly m update and fly secrets set --stage, although the details are a little convoluted and hard to find.

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