so I have a NodeJS app running that has 2 machines, which sends the response twice for every interaction with my app. How can I turn off 1 machine and keep only 1 running?
Will that somehow affect my app? Like slow it down or cause other issues if I run my app on just 1 machine?
which sends the response twice for every interaction with my app
That sounds off. If your app is an HTTP service, the requests should be being load balanced between the 2 machines. Would you mind giving more details about your app and what is happening so we can figure this out and find a better solution?
How can I turn off 1 machine and keep only 1 running?
Will that somehow affect my app? Like slow it down or cause other issues if I run my app on just 1 machine?
Yes. We don’t recommend running a single machine because if the machine goes down for any reason, your whole app goes down.
That sounds off. If your app is an HTTP service, the requests should be being load balanced between the 2 machines. Would you mind giving more details about your app and what is happening so we can figure this out and find a better solution?
I am testing a discord bot that runs on NodeJS and JavaScript, but whenever I execute a command with 2 machines running the bot gets an API error probably because of the rate limit also it sends the bot response twice in the channel.
Check your app logs. What shows up on the logs when you make a request? Does the 2 machines receive the same request? Can you also post the API error you mentioned?
In the logs, When I make a request it gets executed 2 times because of 2 machines which result in double response and also which leads to this API error
DiscordAPIError: Unknown interaction
There isn’t much to it in logs , but it works fine when I stop one of the two machines.
2023-08-17T09:51:36.256 app[6e82dd96f05e98] atl [info] Bot is ready!
2023-08-17T09:51:51.166 app[6e82dd96f05e98] atl [info] Error with the Command "ping" - Action #3 (Send Message):
2023-08-17T09:51:51.166 app[6e82dd96f05e98] atl [info] DiscordAPIError: Unknown interaction
This is what the log looks like, The output should not give anything in logs except “Bot is ready!” But because of 2 machines, I get the same error repeated and the command posts two responses. The error you see doesn’t stop the bot from working, on the user side it works fine but just gives 2 responses, and on the backend when I monitor logs, this is the error I see every time.