Other Articles

Cosmos DB for PostgreSQL – Monitor Memory Utilization

This check ensures that memory utilization is actively monitored for Azure Cosmos DB for PostgreSQL clusters to maintain optimal performance, prevent resource exhaustion, and support high availability requirements.

Check Details

  • Resource: Azure Cosmos DB for PostgreSQL
  • Check: Ensure Memory utilization Is Monitored
  • Risk: Failure to monitor memory utilization may result in degraded performance, query failures, unexpected downtime, and potential service disruption due to resource exhaustion.

Remediation via Azure Portal

  1. Log in to the Azure Portal. Azure Portal dashboard
  2. Navigate to Azure Cosmos DB for PostgreSQL and select the relevant cluster. Cosmos DB for PostgreSQL clusters list
  3. Under Monitoring, select Metrics. Cosmos DB for PostgreSQL metrics
  4. From the metric drop-down list, select Memory percent. Cosmos DB for PostgreSQL memory utilization metrics
  5. Configure a Metric alert to trigger when memory utilization exceeds a defined threshold (for example, 80%). Cosmos DB for PostgreSQL memory utilization alerts
  6. Save the alert rule to ensure continuous monitoring.

Remediation via Azure CLI

  1. Open Azure Cloud Shell or a local terminal with Azure CLI installed. Azure Cloud Shell
  2. Retrieve available metrics for the PostgreSQL cluster:
    az monitor metrics list-definitions \
     --resource <resource-id>
    
  3. Create a metric alert for memory utilization:
    az monitor metrics alert create \
     --name <alert-name> \
     --resource-group <resource-group> \
     --scopes <resource-id> \
     --condition "avg MemoryPercent > 80" \
     --description "Alert when memory utilization exceeds 80 percent" \
     --evaluation-frequency 5m \
     --window-size 5m \
     --severity 2
    
  4. Verify that the alert rule has been created:
    az monitor metrics alert list \
     --resource-group <resource-group>
    

Replace <resource-id>, <resource-group>, and <alert-name> with your actual values. The alert ensures continuous monitoring of memory utilization and supports proactive performance management.