What is the purpose of the "processes" section in [[services]]?

I’m trying to run a nodeJS + uwebsockets server, that:

  1. runs an HTTP server on port 300
  2. run one websocket server on port 9001
  3. runs another websocket server on port 9002

I’m modifying my fly.toml to make this happen.
One thing I’m confused about is the purpose of the “processes” section in [[services]]. What should I put there and why?

Each process runs in a separate VM but on the same physical host. Useful when you’d like to run, say, multiple microservices that need to be as close to each other as possible, but have their own scaling characteristics. See: Preview: multi process apps (get your workers here!)

Multi-process Fly apps are in beta, afaik, and it is unclear (to me) how autoscaling / vm scaling works.

One could also run multiple processes in the same Fly app (single VM), ref: Running Multiple Processes Inside A Fly.io App · Fly Docs

Or, one could deploy multiple apps (from the same codebase) as different Fly apps (separate VMs across hosts): Monorepo and Multi-Environment Deployments · Fly Docs

1 Like