Resource Monitoring & Optimization | CPU Memory Storage Guide | Nife Docs

Monitor your infrastructure resource usage and understand utilization trends.

What are Resource Metrics?#

Resource metrics show how much CPU, memory, and storage you're using:

  • CPU Usage - Processor utilization percentage
  • Memory Usage - RAM consumption percentage
  • Storage Usage - Disk space used percentage

Reading the Resource Chart#

The dashboard shows a Resource Utilization Trends chart displaying:

  • X-axis: Time - Hourly or daily timestamps
  • Y-axis: Usage % - Percentage of total capacity
  • Three lines: CPU, Memory, Storage

Understanding the Chart#

High usage (75%+):

  • Close to capacity limits
  • May need scaling
  • Could cause slowdowns

Medium usage (50-75%):

  • Good utilization
  • Room for growth
  • Watch for spikes

Low usage (0-50%):

  • Excess capacity
  • Could consolidate
  • Room for growth

CPU Usage#

What it means:

  • How much processor power you're using
  • Higher = More processing happening
  • Percentage of total CPU capacity

Normal ranges:

  • 0-30% - Light usage, fine
  • 30-70% - Normal operation
  • 70-90% - Heavy usage, monitor
  • 90%+ - Critical, needs scaling

High CPU causes:

  • Code inefficiency
  • Too many requests
  • Complex calculations
  • Memory issues forcing swap

Solutions:

  1. Optimize code - Make algorithms faster
  2. Scale up - Larger instance
  3. Scale out - More instances
  4. Cache results - Reduce recalculation
  5. Load balance - Distribute traffic

Memory Usage#

What it means:

  • How much RAM (temporary storage) you're using
  • Higher = More data in memory
  • Percentage of allocated memory

Normal ranges:

  • 0-40% - Light usage
  • 40-70% - Good utilization
  • 70-85% - Getting high
  • 85%+ - Very high, optimize

High memory causes:

  • Memory leaks in application
  • Large datasets in memory
  • Insufficient allocation
  • Caching too much data

Solutions:

  1. Fix leaks - Debug application
  2. Optimize data - Use efficient structures
  3. Increase RAM - Add more memory
  4. Reduce cache - Be selective
  5. Stream data - Process chunks

Storage Usage#

What it means:

  • How much disk space you're using
  • Permanent storage for files, databases, logs
  • Percentage of allocated storage

Normal ranges:

  • 0-50% - Light usage, fine
  • 50-80% - Good utilization
  • 80-90% - Getting full
  • 90%+ - Critical, add space

High storage causes:

  • Large databases
  • Many files/logs
  • Unused backups
  • Temp files not cleaned

Solutions:

  1. Clean up - Remove unused files
  2. Archive - Move old data
  3. Compress - Reduce file size
  4. Add storage - Increase capacity
  5. Manage logs - Clean old logs

Time Range Selection#

Change the date range to see:

  • Last 24 hours - Hourly breakdown
  • Last 7 days - Daily trends
  • Last 30 days - Monthly overview
  • Custom range - Specific dates

Why check different periods:

  • Identify patterns
  • Spot problems early
  • Plan capacity
  • Forecast growth

Identifying Patterns#

Look for patterns in your data:

Spikes#

  • Sudden increases
  • May indicate problem
  • Or normal peak traffic
  • Investigate if unexpected

Trends#

  • Gradual increase over time
  • Indicates growing usage
  • Plan scaling
  • May need optimization

Cycles#

  • Daily patterns (business hours higher)
  • Weekly patterns (weekday vs weekend)
  • Monthly patterns (seasonal)
  • Plan accordingly

Resource Optimization Tips#

CPU Optimization#

โœ“ Profile your application
โœ“ Optimize hot code paths
โœ“ Use caching appropriately
โœ“ Implement rate limiting
โœ“ Use async processing

Memory Optimization#

โœ“ Fix memory leaks
โœ“ Use efficient data structures
โœ“ Stream large files
โœ“ Clear unused objects
โœ“ Monitor allocations

Storage Optimization#

โœ“ Compress old data
โœ“ Archive unused files
โœ“ Clean temporary files
โœ“ Database optimization
โœ“ Log rotation

Scaling Decisions#

When to Scale Up#

Signs:

  • Consistent high usage (>80%)
  • Frequent alerts
  • Performance complaints
  • Peak traffic causing issues

Options:

  1. Increase instance size - More resources
  2. Add more instances - Horizontal scaling
  3. Optimize code - Use resources efficiently
  4. Use auto-scaling - Automatic adjustment

When to Scale Down#

Signs:

  • Consistently low usage (<30%)
  • Money being wasted
  • Excess capacity
  • Consolidation opportunity

Options:

  1. Reduce instance size - Fewer resources
  2. Reduce instance count - Fewer machines
  3. Combine services - Share resources
  4. Use spot instances - Cheaper options

Monitoring Best Practices#

โœ“ Regular checks - Review metrics daily
โœ“ Set baselines - Know your normal usage
โœ“ Track trends - Watch for changes
โœ“ Compare periods - Week over week
โœ“ Alert setup - Know when to worry
โœ“ Document - Record capacity planning decisions

Common Scenarios#

Scenario: Sudden CPU Spike#

  1. Check time - Traffic peak?
  2. Review deployments - New code?
  3. Check alerts - Any errors?
  4. Monitor - Will it come down?
  5. Act if persistent - Investigate or scale

Scenario: Growing Memory Usage#

  1. Check for memory leaks
  2. Review recent changes
  3. Monitor growth rate
  4. Increase memory if needed
  5. Restart service if persistent

Scenario: Storage Almost Full#

  1. Run cleanup
  2. Archive old data
  3. Delete temp files
  4. Check database size
  5. Add storage if needed

Scenario: Consistent High Usage#

  1. Current sizing adequate?
  2. Cost-benefit analysis
  3. Performance acceptable?
  4. Plan upgrade
  5. Schedule migration

Resources and Documentation#

Getting Help#

If you need help:

  1. Check resource metrics first
  2. Review alert messages
  3. Check documentation
  4. Contact support with:
    • Screenshots of metrics
    • Time period of issue
    • What changed recently