Could be a shortage of virtual memory: try adding RAM or adding swap. (Fork failing with EAGAIN can be memory shortage)
Have a look at
free -h
vmstat 5 5
There are two kernel tunables which can improve memory efficiency
cat /proc/sys/vm/overcommit_memory
cat /sys/kernel/mm/transparent_hugepage/enabled