Hi Arsen,
Thanks for reaching out to Microsoft Q&A.
Given the regularity of the spikes and the lack of other activity, it’s likely that these spikes are caused by azure's internal maintenance tasks or background processes that might not be immediately visible via standard monitoring tools.
few possibilities:
- Azure Infrastructure Maintenance: Even though your server is not under heavy load, Azure performs various internal maintenance tasks that could cause CPU usage spikes. These could include patching, performance optimization, or internal checks.
- Database Engine Tasks: PostgreSQL might be performing internal tasks such as auto-vacuuming, index maintenance, or other background processes that could contribute to periodic CPU spikes.
- Metrics Collection and Monitoring: Azure might periodically collect detailed metrics or perform health checks that could temporarily increase CPU usage.
- Bursting on B2s Tier: The B2s VM size uses burstable CPUs, which means that the server might accumulate CPU credits when idle and use them during these periodic spikes. This could manifest as a higher CPU percentage during short bursts of activity.
Since the pg_stat_activity
and server logs showing nothing unusual and that the server is not connected to anything externally, these internal tasks are the most likely causes. Unfortunately, these tasks are often not directly visible or controllable by the users, so the best approach might be to monitor the servers behavior over time and consider upgrading to a non-burstable VM size if the spikes are causing you a concern. If you want to dig deeper, you might also consider enabling more detailed logging or using Azure Monitor to track any other potential background activities that could be contributing to the spikes.
Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.