Greetings!
If I understand correctly, you have an outbound job on your droplet which reaches out to an external API. You want to balance that task so that the requests do not all come from the same IP. If I am understanding this correctly, there may not be one correct answer from a generic perspective that can be guaranteed to fit your situation.
These are a couple of thoughts:
If it were a cron job, for example, you could just do the cron job half as often from two servers.
If you created multiple proxies for the API requests you could then put those behind an haproxy instance. So like let’s say the endpoint is api.externalservice.com, I could make:
- haproxy (apiproxy.myservice.com)
- - proxy1 (proxy1.myservice.com) -> api.externalservice.com
- - proxy2 (proxy2.myservice.com) -> api.externalservice.com
Then I could have haproxy balance all outbound traffic through the two servers under it. Setting this up isn’t something I could directly advise on as I’m unfamiliar with your specific situation, but in theory a stack like this could function quite well. You can use haproxy for just about anything that requires load balancing. You can see me doing it with SMTP here: https://d.pr/i/4Lfbtq
Jarland