Out of memory: Kill process or sacrifice child (redis-server)

Started by filz51, March 08, 2020, 06:37:22 PM

Previous topic - Next topic

filz51

redis-server is filling the swap file (2 GB) up to 100%. The system kills the process (redis-server) then. How can I prevent this? No clue in redis.log but maybe redis.conf needs to be adjusted? Any suggestions?
Cheers, filz51

Sandeep

you need to define a memory limit for redis in redis config

filz51

Hi Sandeep

Thanks, I understand. I added a new line in /etc/redis.conf
maxmemory 524288000
but Redis-Server was gone again after some hours. Side effect: php-fpm.log is now 1 GB+ and shows a new warning:
server reached max_children setting (4), consider raising it I guess that warning is related to the run out of memory.

Is there a method to calculate reasonable values for the memory limit or shall I try with lower values and see what is happening? And what are reasonable values for max_children?


Sandeep

you need to increase php-fpm process to some what 20 in webserver main settings. Ensure you've 2 gb and above ram (not swap)

filz51

The Server worked stable for more than one day. Looks like some of the changed settings were needed. But I was facing a run out of memory again one hour ago. This time it process "clamd" was killed.

Out of memory: Kill process 25856 (clamd) score 189 or sacrifice child.
Killed process 25856 (clamd), UID 989, total-vm 910636 kB, anon-rss: 786100 kB, file-rss: 0kB, shame: 0kB


Output from vmstat:
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
  r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
16  3 1407748 156600      0 270352   69   56  2134   825  193  113 13  4 82  0  0


I don't understand what the logs are telling me and what I have to do now.