So all processes have died (no samba, ssh, webUI...) , but the kernel was still running (ping).
That could be caused because some process required too much memory and the kernel killed all process to reclaim memory. This is what is named "
OOM killer". It should obviously not happens frequently.
I experienced that when trying to stress test the Firmware Updater on a DNS-323 without any swap active and using deliberately a wrong and huge 45MB fw file for a DNS-320L (trying to reproduce
bug 369). Without swap, /tmp only has 32MB available, so in order to fulfill the 45MB request the kernel started killing samba, then dropbear, then httpd, then inetd, then sysctrl... then everything else. Eventually it gave up, but no process was left running. I observed all this behaviour through a serial console.
You must be warned that rsync can consume a lot of memory, as it creates an internal file list (100bytes per file) even when no file is going to be transmitted. On my desktop computer home folder that means 352MB just for the file list!!!
Even if a rsync don't cause a OOM, because swap is active, paging (swapping) starts to occur, turning the whole system very slow and unusable. I can't obviously use rsync on my desktop home folder on a DNS-323, I have to use a DNS-325 (and I don't rsync the whole home folder)
That is the reason why sometimes there is a need to split a rsync into several rsyncs, where each one is limited on the number of files. There are some scripts dedicated to this purpose.
I tried using the following script to reduce rsync memory needs. It starts a rsync process using at most NFILES, waits for it to complete, then starts another rsync, etc.
#!/bin/sh
# cp -a did 48MB/s
# rsync did 15MB/s
#set -x
# create NFILES lines files list to rsync
if test $# != 2; then
echo rsync-split.sh source_dir dest_dir
exit 1
fi
SDIR=$1/
DDIR=${2%%/}
echo $SDIR $DDIR
OPTS="-ahx --info=progress2" # --no-dirs
NFILES=100000 # 10MB memory + 10MB in memory file flist, total 20MB per rsync process
#NFILES=10000 # 1MB memory
cd $SDIR
i=0
rm -f /tmp/foo
find . | while read -r t; do
echo "$t" >> /tmp/foo
i=$((i+1))
if test $i = $NFILES; then
wait
i=0
mv /tmp/foo /tmp/bar
rsync --files-from=/tmp/bar $OPTS $SDIR $DDIR &
fi
done
if test -s /tmp/foo; then
wait
rsync --files-from=/tmp/foo $OPTS $SDIR $DDIR
fi
rm -f /tmp/foo /tmp/bar