I have a relatively small greenbone installation on Docker. This is built from community containers 22.4.
the problem is when i start a scan around 90% crashes them because of the Linux kernel oom_kill.
I get message in the kernel log:
...
The memory in VM 16GB
...This Redis oom killed on one host scan - #3 by kayapo definetly helped but the final solution is the redis configuration changes:
maxclients 100
maxmemory 2147483648
maxmemory-policy volatile-ttl
tcp-keepalive 15
At this time all of my scan is running without problem.https://forum.greenbone.net/t/redis-oom-killed-on-one-host-scan/15722/5 2023
2147483648 = 2G
/etc/redis/redis-openvas.conf maxclients 10000 maxmemory 未設定 (0 無限に保存) maxmemory-policy 未設定 (noeviction 自動削除されないエラー) tcp-keepalive 300 (確認) $ sudo redis-cli -s /run/redis-openvas/redis-server.sock redis /run/redis-openvas/redis-server.sock> INFO memory ... maxmemory:0 maxmemory_human:0B maxmemory_policy:noeviction
openvasのアイテムはTTL設定されてない
redis /run/redis-openvas/redis-server.sock> INFO keyspace # Keyspace db0:keys=1,expires=0,avg_ttl=0 db1:keys=49995,expires=0,avg_ttl=0 db2:keys=183757,expires=0,avg_ttl=0 redis /run/redis-openvas/redis-server.sock> select 1 redis /run/redis-openvas/redis-server.sock[1]> TTL "internal/notus/advisories/1.3.6.1.4.1.25623.1.1.4.2020.1608.1" (integer) -1
Redisのmaxmemoryについて - DENET 技術ブログ 2017
ElastiCacheのRedisではvolatile-lru がデフォルトの設定になっています。
...
DockerのRedisイメージのデフォルトだとmaxmemoryが0なので無限に保存できてしまいます。
また、noevictionなのでメモリが溢れても自動削除されない設定になっています。
Redisのメモリが100%を超えたときの挙動の調査・検証 #AWS - Qiita 2022
デフォルトではvolatile-lruが設定されています。そうです、あくまで、有効期限(TTL)のあるキーの中でなんです。
ElastiCache Redisのメモリ溢れが起きたときの挙動、正しく理解できてますか?? | DevelopersIO 2020