Author Topic: Out of memory: Kill process or sacrifice child (redis-server)  (Read 6339 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
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

Offline
*****
Re: Out of memory: Kill process or sacrifice child (redis-server)
« Reply #1 on: March 09, 2020, 09:33:27 AM »
you need to define a memory limit for redis in redis config

Offline
*
Re: Out of memory: Kill process or sacrifice child (redis-server)
« Reply #2 on: March 09, 2020, 11:21:05 AM »
Hi Sandeep

Thanks, I understand. I added a new line in /etc/redis.conf
Code: [Select]
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:
Code: [Select]
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?


Offline
*****
Re: Out of memory: Kill process or sacrifice child (redis-server)
« Reply #3 on: March 09, 2020, 04:45:27 PM »
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)

Offline
*
Re: Out of memory: Kill process or sacrifice child (redis-server)
« Reply #4 on: March 12, 2020, 02:01:25 PM »
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.

Code: [Select]
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

Code: [Select]
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.