Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Latest commit

 

History

History
147 lines (110 loc) · 4.05 KB

File metadata and controls

147 lines (110 loc) · 4.05 KB
title Docker Resources
description Configure Docker container resource limits and reservations

Parameter Reference

Quick reference for all available Docker resource parameters:

Parameter Description
DOCKER_CPU_LIMIT CPU limit in cores
DOCKER_MEMORY_LIMIT Memory limit
DOCKER_CPU_RESERVATION Minimum CPU reservation
DOCKER_MEMORY_RESERVATION Minimum memory reservation

Resource Limits

Maximum CPU allocation for Docker containers in number of cores.

Examples:

  • 2.0 - 2 CPU cores (default)
  • 4.0 - 4 CPU cores for high-performance workloads
  • 1.0 - 1 CPU core for resource-constrained environments
  • 0.5 - Half a core (minimum viable)
This is a hard limit. Containers cannot exceed this CPU allocation even if resources are available.

Maximum memory allocation for Docker containers.

Format:

  • Use suffixes: G (gigabytes), M (megabytes)
  • Examples: 4G, 512M, 8G

Examples:

  • 4G - 4 gigabytes (default)
  • 8G - 8 gigabytes for video processing workloads
  • 2G - 2 gigabytes for lightweight deployments
  • 1G - 1 gigabyte (minimum recommended)
Setting memory too low can cause container crashes. Ensure sufficient memory for your workload, especially for video processing.

Resource Reservations

Minimum guaranteed CPU allocation for Docker containers.

Examples:

  • 0.5 - Half a core guaranteed (default)
  • 1.0 - 1 CPU core guaranteed
  • 2.0 - 2 CPU cores guaranteed for critical workloads
  • 0.25 - Quarter core (minimum)
Reservations ensure containers always have access to a minimum amount of resources, even under high load.

Minimum guaranteed memory allocation for Docker containers.

Format:

  • Use suffixes: G (gigabytes), M (megabytes)
  • Examples: 1G, 512M, 2G

Examples:

  • 1G - 1 gigabyte guaranteed (default)
  • 2G - 2 gigabytes guaranteed
  • 512M - 512 megabytes (minimum)
  • 4G - 4 gigabytes for memory-intensive workloads
Reservations should be lower than limits. They ensure containers have minimum resources available.

Configuration Examples

DOCKER_CPU_LIMIT=2.0
DOCKER_MEMORY_LIMIT=4G
DOCKER_CPU_RESERVATION=0.5
DOCKER_MEMORY_RESERVATION=1G

Standard development configuration with default resource allocations.

DOCKER_CPU_LIMIT=4.0
DOCKER_MEMORY_LIMIT=8G
DOCKER_CPU_RESERVATION=1.0
DOCKER_MEMORY_RESERVATION=2G

High-performance production setup with increased resources for video processing.

DOCKER_CPU_LIMIT=1.0
DOCKER_MEMORY_LIMIT=2G
DOCKER_CPU_RESERVATION=0.25
DOCKER_MEMORY_RESERVATION=512M

Minimal resource configuration for lightweight deployments.

Best Practices

Plan CPU and memory limits based on your workload. Video processing requires more resources than image-only operations. Allocate sufficient memory for video processing. Insufficient memory can cause job failures. Resource limits are enforced by Docker. Setting limits too low can cause container crashes or job failures. Monitor container resource usage and adjust accordingly.