After we did that nothing really changed, still peaking 100% and when checking clock speed its only 2.6Ghz.
The f series
base clock speed is 2.7GHz. It can boost up to 3.7GHz as needed to handle the load. And since, the vCPUs are not changed after you updated the VM series (from B4ms
to F4s_v2
), the performance has not improved. If you choose a size which has more vCPUs than 4, you will see the difference.
To resolve performance issues, in general, you must figure out what is using the CPU. If your application is the culprit of increased CPU utilization, it could take considerable effort to debug and find the issue. In the meantime you can increase capacity temporarily while you look into the issue. If your VMs are receiving load-balanced traffic in an Availability Set, you can add more VMs to receive traffic, reducing the share of work each VM has to perform. Otherwise you can increase the size of your VMs to a type that has more vCPU.
For memory-intensive applications running on the JVM, high CPU usage can actually be a symptom of high memory usage. Check your JVM configuration, especially regarding the HEAP_SIZE and see if the CPU usage is caused by JVM garbage collection.
Further, I would advise you to run Performance Diagnostics
on your VM and troubleshoot to find out the bottle necks: Azure VM Performance Diagnostics. Using this, you can dig in more about the processes which caused these issues:
If you expand the Findings event, you'll see several key details. The tab lists the processes in descending order, per Average CPU consumption, and shows whether the process was related to the system, a Microsoft-owned app (SQL, IIS), or a third-party process.
This would make you aware about the processes which are causing high CPU usage and will help you remove those bottlenecks.
Let me know if this answers your question.
-----------------
Please do not forget to "Accept the answer" wherever the information provided helps you. This will help others in the community as well.