Skip to content

limit redis to 1gb#15

Open
davidbeig wants to merge 3 commits intomainfrom
docker/restrict_resources
Open

limit redis to 1gb#15
davidbeig wants to merge 3 commits intomainfrom
docker/restrict_resources

Conversation

@davidbeig
Copy link
Contributor

@davidbeig davidbeig commented Feb 24, 2026

Following the documentation of the deploy configuration in docker-compose, we can limit resources to a specific container.

In this case we are limiting the redis database to only 1Gb of memory.

https://docs.docker.com/reference/compose-file/deploy/#resources

To test if you can do:

docker compose up redis -d
docker stats # to see that the memory has been limited to 1Gb
```

Also check for redis maxmemory and maxmemory-policy

```bash
redis-cli CONFIG get maxmemory
redis-cli CONFIG get maxmemory-policy
```

@davidbeig davidbeig requested a review from microstudi February 24, 2026 15:59
@davidbeig davidbeig self-assigned this Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant