[A bit of an update regarding the Discord bot: As many of you may know, there have been many lag issues lately as well as an increased number of errors related to image commands. I’ll try and break that down here as well as talk about the “permanent solution” that I’ve promised.]
[What does make a big difference, however, is the size of the bot and all of the actions it has to run at once. The bot is currently using around 1.5GB of memory, and that’s only counting what’s used by V8 (the JavaScript runtime used by Node).]
[Most of the usage is coming from the way that Eris (the library the bot uses to interact with Discord) caches guild and user objects, which is mostly out of my control. You might be wondering though, “Doesn’t the server have 8GB of RAM? Why is it running out with only 1.5 GB?”]
[That’s because of the very thing the bot is used the most for: the image commands. I’ve been running them locally on the server the whole time because I never expected the bot to get as big as it is now.]
[Image processing is very intensive due to it using many CPU threads and needing to cache the pixels in RAM, and it doesn’t help that I chose quite possibly the worst solution to run it in production: spawning many processes individually *on the same server*.]
[That is not a very good solution, which leads me to talk about the promised solution. If you’ve been following the progress on the Git repo ( http://github.com/esmBot/esmBot ) then you would know that the external calls have been replaced with native C++ code to allow more control.]
[However, while it does speed things up a bit, this alone is not a good enough solution; everything would still be running on the same server. That’s why I intend to create a Kubernetes cluster as well as an API to evenly spread processing across multiple servers.]
[The update this change will appear in is mostly finished and feature-complete; however, there are still many known bugs that need to be taken care of before I release it. I might do a public test beforehand to find more bugs and give a taste of what’s to come.]
[This solution, however, is not cheap by any means. It will require a lot of cash to run multiple servers at once, and I don’t have much money in my pockets to keep the bot running in the first place.]
[I hope this thread clears up any confusion about what’s going on. The bot isn’t dead by any means; it’s just getting more difficult to run. If you want to test the upcoming changes right now, you can join the esmBot Support server and run commands in the #dev-bot-cmds channel.]
[Thank you for the support. - @TheEssem]
You can follow @esmBot_.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: