Hi guys,
since a few days my monitoring alerts me due to RAM usage >80%. I’m running mailcow on a Hetzner VPS with 16GB RAM for some years now and never really went over 60-70%.

So I checked the Docker containers for their RAM usage:
root@mailserver:/opt/mailcow-dockerized# docker stats --no-stream --format "table {{.Name}}\t{{.MemUsage}}\t{{.MemPerc}}"
NAME MEM USAGE / LIMIT MEM %
mailcowdockerized-watchdog-mailcow-1 34.3MiB / 15.25GiB 0.22%
mailcowdockerized-acme-mailcow-1 6.973MiB / 15.25GiB 0.04%
mailcowdockerized-nginx-mailcow-1 17.82MiB / 15.25GiB 0.11%
mailcowdockerized-rspamd-mailcow-1 692.4MiB / 15.25GiB 4.43%
mailcowdockerized-ofelia-mailcow-1 272.1MiB / 15.25GiB 1.74%
mailcowdockerized-postfix-mailcow-1 84.07MiB / 15.25GiB 0.54%
mailcowdockerized-dovecot-mailcow-1 172.2MiB / 15.25GiB 1.10%
mailcowdockerized-php-fpm-mailcow-1 114MiB / 15.25GiB 0.73%
mailcowdockerized-clamd-mailcow-1 1021MiB / 15.25GiB 6.54%
mailcowdockerized-mysql-mailcow-1 311.5MiB / 15.25GiB 1.99%
mailcowdockerized-postfix-tlspol-mailcow-1 45.9MiB / 15.25GiB 0.29%
mailcowdockerized-redis-mailcow-1 7.163GiB / 15.25GiB 46.96%
mailcowdockerized-sogo-mailcow-1 411.6MiB / 15.25GiB 2.64%
mailcowdockerized-memcached-mailcow-1 12.45MiB / 15.25GiB 0.08%
mailcowdockerized-dockerapi-mailcow-1 54.45MiB / 15.25GiB 0.35%
mailcowdockerized-unbound-mailcow-1 41.21MiB / 15.25GiB 0.26%
mailcowdockerized-olefy-mailcow-1 15.26MiB / 15.25GiB 0.10%
mailcowdockerized-netfilter-mailcow-1 33.15MiB / 15.25GiB 0.21%
mailcow-logs-app 189.9MiB / 15.25GiB 1.22%
mailcow-logs-db 234.6MiB / 15.25GiB 1.50%
7GB+ for Redis, that’s crazy! mailcow is running for some years now, and it seems that Redis is configured without limit and eviction policy:
root@mailserver:/opt/mailcow-dockerized# docker compose exec rspamd-mailcow redis-cli -h 172.22.1.249 -p 6379 -a $(grep REDISPASS mailcow.conf | awk -F= '{print $2}') info memory | grep maxmemory
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
Redis collected about 9 million strings so far without ever cleaning up old entries:
root@mailserver:/opt/mailcow-dockerized# docker compose exec rspamd-mailcow redis-cli -h 172.22.1.249 -p 6379 -a $(grep REDISPASS mailcow.conf | awk -F= '{print $2}') --bigkeys
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
# Scanning the entire keyspace to find biggest keys as well as
# average sizes per key type. You can use -i 0.1 to sleep 0.1 sec
# per 100 SCAN commands (not usually needed).
100.00% ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Keys sampled: 9186428
-------- summary -------
Total key length in bytes is 448657330 (avg len 48.84)
Biggest list found "API_LOG" has 10065 items
Biggest hash found "learned_ids" has 34202 fields
Biggest string found "MAIN_LOGO_DARK" has 1253950 bytes
Biggest set found "rn_LONG_default_bh4p4too_3_ham_set" has 8097 members
Biggest zset found "rsrkokqc19wnidi1ou6ndpn4" has 30 members
10 lists with 82208 items (00.00% of keys, avg size 8220.80)
52192 hashs with 103810 fields (00.57% of keys, avg size 1.99)
0 streams with 0 entries (00.00% of keys, avg size 0.00)
9134006 strings with 5690225325 bytes (99.43% of keys, avg size 622.97)
209 sets with 64569 members (00.00% of keys, avg size 308.94)
11 zsets with 49 members (00.00% of keys, avg size 4.45)
I wanted to ask around if you are seeing a similar development regarding your memory usage. I’m thinking about setting a maxmemory limit and and eviction policy myself, as in the current state the Redis DB will grow unlimited…