A project using too much CPU of unknown causes?


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


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.


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.


100% cpu on chrome browser !


I also experience high cpu from up to 60% to 80%.
This has been happening for some time now, and I have no idea why, My bot does use music, but I have the music on a seperate glitch project.