Why have my cpu credits suddenly disappeared?

James Hicks 0 Reputation points
2024-01-11T16:09:29.3333333+00:00

I have several AVD VMs running on Standard B4MS CPUs. Not had any performance problems for months until this week, when suddenly some of the VMs started running at 100% CPU. The VM metrics show that until this week, CPU credits were constantly at 1200. Then, over the course of a day the credits went down to zero. The CPU credit usage graph normally averages less than 1, but has spiked at around 2.5 this week. Where have all my credits gone? Is the system broken?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,049 questions
Windows for business | Windows Client for IT Pros | Devices and deployment | Other
{count} votes

3 answers

Sort by: Most helpful
  1. kobulloc-MSFT 26,811 Reputation points Microsoft Employee Moderator
    2024-01-11T19:16:03.74+00:00

    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:

    https://learn.microsoft.com/en-us/azure/virtual-machines/b-series-cpu-credit-model/b-series-cpu-credit-model#credits-accumulation-and-consumption

    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! User's image

    1 person found this answer helpful.
    0 comments No comments

  2. Wesley Li 11,280 Reputation points
    2024-01-17T07:25:48.5033333+00:00

    Hello Regarding the cpu credits on AVD, try check the information in below link: There are certain VM series, such as B (Burst Mode) Series, that are recommended for quality assurance (QA) and testing. Using these series in the production environment limits the computing capability after the CPU credits are exhausted. To monitor B-series specific credit metrics, you can utilize the Azure monitor data platform Troubleshoot high-CPU issues for Azure virtual machines - Virtual Machines | Microsoft Learn B Series CPU Credit Model - Azure Virtual Machines | Microsoft Learn Also try some methods to check the CPU 100% issue:

    1. Since Windows itself needs some background processes to run, many background processes will run on the computer at the same time, and it may cause high CPU usage. Try end the Processes that Cause High CPU Usage.
    2. If the CPU usage is very high, and you’re not running any program that would impact it, you can open Task Manager to check it. Search for Services and open. Click Application Management and Restart the service. 3.Viruses on your PC can cause the 100% CPU usage issue, try run windows defender to do a full scan.   Best Regards, Wesley Li ============================================ If the Answer is helpful, please click "Accept Answer" and upvote it.
    0 comments No comments

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.