Resource Monitoring

Monitor system resources and performance.

Monitor your server's resources to ensure optimal performance for your Supabase projects.

Accessing Resources

Via Web UI

Navigate to Resources in the sidebar to see:

  • Real-time CPU usage
  • Memory utilization
  • Disk space
  • Network I/O
  • Process list

Via API

curl https://supascale.example.com/api/v1/system/resources \
  -H "X-API-Key: your-api-key"

Response:

{
  "cpu": {
    "usage": 25.5,
    "cores": 4,
    "model": "Intel Core i7",
    "loadAverage": [1.2, 0.8, 0.6]
  },
  "memory": {
    "total": 8589934592,
    "used": 4294967296,
    "free": 4294967296,
    "usagePercent": 50
  },
  "disk": {
    "total": 107374182400,
    "used": 53687091200,
    "free": 53687091200,
    "usagePercent": 50
  },
  "network": {
    "bytesIn": 1073741824,
    "bytesOut": 536870912
  }
}

CPU Monitoring

Metrics

MetricDescription
Usage %Current CPU utilization
CoresNumber of CPU cores
Load Average1, 5, 15 minute averages
ModelCPU model name

Load Average Guidelines

Load/CoreStatusAction
< 0.7HealthyNone needed
0.7 - 1.0ModerateMonitor
> 1.0HighInvestigate
> 2.0CriticalReduce load

Example: 4-core server with load average 3.0 = 0.75 load/core (moderate)

Memory Monitoring

Metrics

MetricDescription
TotalTotal physical memory
UsedMemory in use
FreeAvailable memory
Usage %Percentage utilized

Memory Guidelines

UsageStatusAction
< 70%HealthyNone needed
70-85%ModerateMonitor closely
85-95%HighPlan upgrades
> 95%CriticalImmediate action

Disk Monitoring

Metrics

MetricDescription
TotalTotal disk capacity
UsedSpace in use
FreeAvailable space
Usage %Percentage utilized

Disk Guidelines

UsageStatusAction
< 70%HealthyNone needed
70-85%ModeratePlan cleanup
85-95%HighCleanup now
> 95%CriticalUrgent cleanup

Cleanup Actions

  1. Delete old backups
  2. Clean Docker images: docker image prune
  3. Remove old logs
  4. Archive old project data

Process Monitoring

View Processes

curl "https://supascale.example.com/api/v1/system/resources?processes=true" \
  -H "X-API-Key: your-api-key"

Response includes:

{
  "processes": [
    {
      "pid": 1234,
      "name": "node",
      "cpu": 5.2,
      "memory": 256000000,
      "memoryPercent": 3.0
    },
    {
      "pid": 5678,
      "name": "postgres",
      "cpu": 2.1,
      "memory": 512000000,
      "memoryPercent": 6.0
    }
  ]
}

Sort Processes

# Sort by CPU
curl "https://supascale.example.com/api/v1/system/resources?processes=true&sortBy=cpu"

# Sort by memory
curl "https://supascale.example.com/api/v1/system/resources?processes=true&sortBy=memory"

Kill Process

Terminate a runaway process:

curl -X POST https://supascale.example.com/api/v1/system/resources \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "kill",
    "pid": 1234,
    "signal": "SIGTERM"
  }'

Signals:

  • SIGTERM - Graceful shutdown (default)
  • SIGKILL - Force kill (use with caution)

Historical Metrics

View metrics over time:

curl "https://supascale.example.com/api/v1/system/resources/history?hours=24" \
  -H "X-API-Key: your-api-key"

Response:

{
  "history": [
    {
      "timestamp": "2026-01-19T00:00:00Z",
      "cpu": 25.5,
      "memory": 50.2,
      "disk": 48.1
    }
  ]
}

Alerts

Set Up Monitoring

  1. Create health check tasks for resource monitoring
  2. Configure email notifications
  3. Define threshold alerts

Example Alert Task

{
  "name": "High Memory Alert",
  "type": "custom",
  "cronExpression": "*/5 * * * *",
  "customConfig": {
    "command": "test $(free | awk '/Mem:/ {printf \"%.0f\", $3/$2 * 100}') -lt 90"
  }
}

Performance Optimization

CPU Optimization

  1. Identify high-CPU processes
  2. Optimize database queries
  3. Scale to more cores if needed
  4. Consider load balancing

Memory Optimization

  1. Restart memory-leaking services
  2. Adjust container memory limits
  3. Add swap space (temporary)
  4. Upgrade RAM

Disk Optimization

  1. Use SSDs for better I/O
  2. Regular cleanup schedules
  3. Move backups to cloud
  4. Monitor growth trends

Best Practices

  1. Regular monitoring - Check daily
  2. Set alerts - Don't wait for problems
  3. Trend analysis - Watch for patterns
  4. Capacity planning - Plan ahead
  5. Document baselines - Know your normal