# Configure RAM and CPU limits for SQL containers

You can limit the CPU and RAM consumption for Docker containers that handle database-related tasks.

Procedure: Configure RAM and CPU consumption

Docker installation:

In the `docker-compose.yaml` file, add the following parameters in the `environment` block:

```YAML
environment:
  ...
  [[[SQL_SESSION_MEMORY|#sql-session-memory]]]: <memory_limit>
  [[[SQL_SESSION_CPUS|#sql-session-cpus]]]: <number_of_cpus>
  [[[MAX_HEAP_SIZE|#max-heap-size]]]: <heap_size_limit>
```

Reference

`SQL_SESSION_MEMORY`
: String
:
:
:
: Memory limit in bytes.
:
:
:
: Supports size suffixes (`K`, `M`, `G`, `T`, `Ki`, `Mi`, `Gi`, and `Ti`). If no suffix is provided, the value is interpreted as bytes.
:
:
:
: Example: `"3G"`

`SQL_SESSION_CPUS`
: String
:
:
:
: Number of CPUs.
:
:
:
: Example: `2`

`MAX_HEAP_SIZE`
: String
:
:
:
: (Optional) Memory allocated to the Java machine.
:
:
:
: Supports decimal suffixes (`K`, `M`, `G`, `T`, `Ki`, `Mi`, `Gi`, and `Ti`). If no suffix is provided, the value is interpreted as bytes.
:
:
:
: Example: `"2G"`
:
:
:
: > **Note:**
: > By default, `MAX_HEAP_SIZE` is set to 1/3 of the `SQL_SESSION_MEMORY` value and often does not need to be customized.

