Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure PostgreSQL flexible server is at 100% cpu utilization

I have an Azure PostgreSQL (version 12) flexible server that has been running at 100% CPU utilization for the last 4 days and the server is currently using 70% of the storage. The Compute core is Standard B1ms (1 vCPU and 2GB Memory)

I have checked SELECT max(now() - xact_start) FROM pg_stat_activity WHERE state IN ('idle in transaction', 'active'); and the response is 00:00:00

I have also checked the command SELECT * FROM pg_stat_activity; and the only applications runnings are autovacuum launcher, pgms_stats_background_worker, pg_qs_background_worker, logical replication launcher, background writer, checkpointer and walwriter

Since there is no query or active background process running, I am out of ideas on what the actual issue could be. Any assistance for this is appreciated.

like image 731
user782400 Avatar asked Mar 04 '26 18:03

user782400


1 Answers

I was finally able to get a resolution to this issue after talking directly to the product team responsible for Azure Postgres Flexible. According to the product team, the underlying issue appears to have been changes in the underlying Linux image used in this service. The latest image was changed changed to CBL-Mariner from Ubuntu. There were some changes in the security stack for this Linux image that increased the idle CPU usage causing the CPU credits to be eaten up on these burstable tiers. Microsoft has recently patched the new image and the performance profile is now on par with older instances I have deployed (though the CPU usage is a little higher at idle). The team has also released a new performance metric CPU Percent From Platform which shows the raw CPU usage of the instance as the CPU Percent takes into account the CPU credits. This will hopefully make it easier to trouble shoot any further issues like this in the future.

like image 100
groogiam Avatar answered Mar 07 '26 07:03

groogiam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!