Hello, @James Hicks !
My VM CPU usage has spiked to 100% and now my credits are gone. What happened? If your CPU use has spiked to 100% and the base CPU performance of a Standard_B4ms is 45%, it makes sense that credits would be used up for bursting:
To conduct calculations on credit accumulations and consumptions, customers can utilize the holistic 'credits banked per minute' formula =>
((Base CPU performance * number of vCPU) - (Percentage CPU * number of vCPU))/100
.
((45% base CPU performance for Standard_B4ms x 4 CPUs) - (100% CPU x 4)) / 100
((45 x 4) - (100 x 4)) / 100
-2.2
If my math is correct here, that would deduct 2.2 credits per VM per minute that it is running at 100% CPU. That's 132 credits an hour and 3,168 credits per day per VM.
What would concern me is if you are seeing a sudden spike in CPU usage and you don't know what the cause is. Have you looked into what is causing the 100% CPU usage?
I hope this has been helpful! Your feedback is important so please take a moment to accept answers.
If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!