How to have certain code running on only one machine?

I run an app that needs to fetch data from an external service. I would like to be able to have multiple machines to handle incoming requests but I only want one of them to make the outgoing requests to the external service.

How can I accomplish this? I looked at the list of environment variables and none of them seem like exactly what I want.

1 Like

@xdrive16321 I believe process groups might help you!

Essentially you could have a web process group to handle request and a external (Im bad at naming) process group to handle external things. Then run:

fly scale count web=8 external=1

And you should be golden!

That looks perfect. Thanks!

1 Like

Anytime! Let me know how that went later

From How To to Questions / Help

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