Closed caykey closed 2 years ago
I think this is the problem https://dev.twitch.tv/docs/irc/guide#rate-limits, in case your bot is not verified
Mhm, yes. I've applied for a Verified bot, but haven't received a response but am more concerned about it more regularly not being able to ping back to Twitch and any problems that my code could have caused to have this deficiency, unless it's Twitch?
I did some debugging, and this was a fault of my message functions sending way too many queries to a database after a message was received. I decided to remove this code as it wasn't necessary to the basic functionality of my bot, and now it's stable.
Sorry for wasting anyone's time (I didn't document in the issue the message function)!
Actual behaviour:
Hello, I own a twitch bot with 9 bot instances, 8 custom instances (1 channel per instance) and another instance with 450+ channels, growing. Every so period, and now more regularly, one or more of the bot instances gets disconnected for not being able to ping twitch back intime resulting in disconnections, and the bot needing to rejoin every channel which can take 10 minutes to complete, which is very frustrating and stressful as it often causes downtime as the main 450 channel instance bot takes a long time to reconnect to all of its channels.
I upgraded my DigitalOcean VPS to have 2 dedicated CPUs and 8 GB of RAM, but it still happens and is an issue and didn't really do much to help but inefficiently increase bills. I don't know what the best way to efficiently scale my bot is. I should also note that on top of the this, my PM2 manager show's a very high P95 Event Loop Latency but a decent Event Loop Latency.
When about 3 of my 1 channel custom instances were disconnected, that were not receiving many event packets, the P95 Event Loop Latency decreased, which leads me to think that these custom instances are making a decent impact of the global performance of the application.
What could I do to my code or implement to my deployment to make my bots scale, I've tried researching about clustering in tmi.js, but haven't had much luck into finding what to do. I am willing to switch to something like AWS as have heard it can horizontally scale, but have never used it.
If you'd like more information about my deployment or application, feel free to ask, I'm happy to answer.
app.js
ā Ran on application startupInstanceManager.js
ā Called on the application startup, with a class functionExpected behaviour:
Constant ping timeouts would not occur in the deployment of my application.
Error log:
Server configuration