Documentation

Settings

Memory Management

The Ellemment Stack implements efficient memory management strategies for optimal application performance.

Memory Configuration

Default Setup

  • Single instance with 256MB base memory
  • 512MB swap file allocation
  • Optimized for initial deployments
  • Scalable as needed

Swap Configuration

Configure swap size in fly.toml:

[mounts]
  .swap_size_mb = 512

Benefits of swap configuration:

  • Prevents out-of-memory crashes
  • Handles memory spikes gracefully
  • Improves application stability
  • Cost-effective resource usage

Memory Scaling

Increasing Memory

Use Fly.io's scale command for memory adjustments:

fly scale memory [amount]

Available memory sizes:

  • 256MB (default)
  • 512MB
  • 1GB
  • 2GB
  • 4GB+

Memory Monitoring

Track memory usage through:

  1. Application metrics
  2. System monitoring
  3. Performance logs
  4. Resource utilization

Best Practices

Memory Optimization

  1. Monitor usage patterns
  2. Adjust swap based on needs
  3. Scale memory gradually
  4. Profile application performance

Resource Management

  1. Regular monitoring
  2. Proactive scaling
  3. Performance benchmarking
  4. Usage optimization

Performance Considerations

Swap Usage

  • Degraded performance over RAM
  • Better than application crashes
  • Temporary resource overflow
  • Cost-effective solution

When to Scale Memory

  • Consistent high swap usage
  • Performance degradation
  • Increased response times
  • Regular OOM incidents

Configuration Guide

Memory Sizing

# fly.toml
[processes]
app_memory_mb = 256

Swap Adjustment

# fly.toml
[mounts]
.swap_size_mb = 512

Monitoring Setup

# fly.toml
[metrics]
port = 9091
path = "/metrics"

For more information about deployment configuration, check the deployment documentation. For performance monitoring details, see the monitoring documentation.