A project using too much CPU of unknown causes?


#1

Help, my project suddenly using too much of CPU, but there’s no compiler or something,
it just a private Discord bot who has features like auto roles, self roles, utility commands, and no music, but I don’t know why this project is using too much CPU (100%) and also when this issue occurs the bot suddenly disconnects from Discord, I don’t know why


#2

Oh also this project normally uses 1 to 5% CPU when it’s normal, but sometimes this project is using 100% CPU and when that issue occurs, the bot dies.


#3

Hi @Hazmi35, tracking down high CPU usage can be difficult under any circumstance. Adding some logging into your application to help track what events or commands are being executed when the project restarts can help track it down. Another option is to disable functions that might be causing the problem to see if you can figure out which piece of code is causing the overage.

The bot disconnecting is expected behavior - when a project persists in a high CPU state Glitch will stop the project and it will restart on the next request, so that would cause a disconnect.