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
| Metric | Description |
|---|---|
| Usage % | Current CPU utilization |
| Cores | Number of CPU cores |
| Load Average | 1, 5, 15 minute averages |
| Model | CPU model name |
Load Average Guidelines
| Load/Core | Status | Action |
|---|---|---|
| < 0.7 | Healthy | None needed |
| 0.7 - 1.0 | Moderate | Monitor |
| > 1.0 | High | Investigate |
| > 2.0 | Critical | Reduce load |
Example: 4-core server with load average 3.0 = 0.75 load/core (moderate)
Memory Monitoring
Metrics
| Metric | Description |
|---|---|
| Total | Total physical memory |
| Used | Memory in use |
| Free | Available memory |
| Usage % | Percentage utilized |
Memory Guidelines
| Usage | Status | Action |
|---|---|---|
| < 70% | Healthy | None needed |
| 70-85% | Moderate | Monitor closely |
| 85-95% | High | Plan upgrades |
| > 95% | Critical | Immediate action |
Disk Monitoring
Metrics
| Metric | Description |
|---|---|
| Total | Total disk capacity |
| Used | Space in use |
| Free | Available space |
| Usage % | Percentage utilized |
Disk Guidelines
| Usage | Status | Action |
|---|---|---|
| < 70% | Healthy | None needed |
| 70-85% | Moderate | Plan cleanup |
| 85-95% | High | Cleanup now |
| > 95% | Critical | Urgent cleanup |
Cleanup Actions
- Delete old backups
- Clean Docker images:
docker image prune - Remove old logs
- 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
- Create health check tasks for resource monitoring
- Configure email notifications
- 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
- Identify high-CPU processes
- Optimize database queries
- Scale to more cores if needed
- Consider load balancing
Memory Optimization
- Restart memory-leaking services
- Adjust container memory limits
- Add swap space (temporary)
- Upgrade RAM
Disk Optimization
- Use SSDs for better I/O
- Regular cleanup schedules
- Move backups to cloud
- Monitor growth trends
Best Practices
- Regular monitoring - Check daily
- Set alerts - Don't wait for problems
- Trend analysis - Watch for patterns
- Capacity planning - Plan ahead
- Document baselines - Know your normal