Skip to main content
Version: Next

Resource Management

This guide covers basic resource configuration for Merobox nodes, including memory and CPU limits for Docker containers.

Basic Resource Configuration​

Merobox supports basic resource limits for Docker containers running Calimero nodes:

Memory and CPU Limits​

nodes:
count: 2
image: ghcr.io/calimero-network/merod:edge
resources:
memory: '1G' # Memory limit
cpus: '0.5' # CPU limit

Environment Variables​

Configure resource-related environment variables:

nodes:
count: 2
image: ghcr.io/calimero-network/merod:edge
environment:
RUST_LOG: 'info'
resources:
memory: '2G'
cpus: '1.0'

Node Configuration​

Basic Node Setup​

Configure Calimero nodes with basic settings:

nodes:
chain_id: testnet-1
count: 2
image: ghcr.io/calimero-network/merod:edge
prefix: calimero-node
base_port: 2428
base_rpc_port: 2528
resources:
memory: '1G'
cpus: '0.5'

Multiple Node Configuration​

Set up multiple nodes with different resource allocations:

nodes:
chain_id: testnet-1
count: 3
image: ghcr.io/calimero-network/merod:edge
prefix: calimero-node
resources:
memory: '2G'
cpus: '1.0'

Environment Variables​

Configure Merobox behavior using environment variables:

Core Configuration​

# Docker daemon connection
export DOCKER_HOST="unix:///var/run/docker.sock"

# Logging level (if supported)
export LOG_LEVEL="INFO" # DEBUG, INFO, WARNING, ERROR

Docker Configuration​

# Docker daemon settings
export DOCKER_HOST="unix:///var/run/docker.sock"

# Docker build settings
export DOCKER_BUILDKIT="1"
export DOCKER_CLI_EXPERIMENTAL="enabled"

Authentication Service​

Configure authentication service for Merobox nodes:

Basic Auth Service​

# Enable authentication service
auth_service: true
auth_image: ghcr.io/calimero-network/mero-auth:edge

nodes:
count: 2
image: ghcr.io/calimero-network/merod:edge
resources:
memory: '1G'
cpus: '0.5'

Auth Service Environment Variables​

# Auth service is configured through CLI flags
# merobox run --auth-service --auth-image ghcr.io/calimero-network/mero-auth:edge

Troubleshooting​

Common Resource Issues​

Check resource usage and node status:

# Check running Merobox nodes
merobox list

# Check node health
merobox health

# View node logs
merobox logs calimero-node-1

# Check Docker container resource usage
docker stats $(docker ps -q --filter "name=calimero-")

Resource Debugging​

Enable debug logging for troubleshooting:

# Enable debug logging
export LOG_LEVEL=DEBUG

# Run workflow with verbose output
merobox bootstrap run workflow.yml --verbose

# Check Docker container details
docker inspect calimero-node-1

Best Practices​

Resource Planning​

  1. Start Small: Begin with minimal resources and scale up as needed
  2. Monitor Usage: Use docker stats to monitor actual resource consumption
  3. Test Workloads: Test your applications with realistic data loads
  4. Plan for Growth: Consider future scaling requirements

Performance Tips​

  1. Memory Allocation: Start with 1-2GB memory per node for most workloads
  2. CPU Allocation: Use 0.5-1.0 CPU cores per node for basic operations
  3. Environment Variables: Use appropriate RUST_LOG levels for debugging
  4. Docker Images: Use specific image tags instead of latest for stability

Troubleshooting Tips​

  1. Check Logs: Always check node logs first when issues occur
  2. Resource Limits: Ensure Docker has sufficient resources available
  3. Network Issues: Verify port availability and network connectivity
  4. Image Updates: Keep Docker images updated for latest features

Next Steps​

Now that you understand basic resource management:

Was this page helpful?
Need some help? Check Support page