Sync Gate Way Suddenly Killed

My sync gateway keeps getting killed. No error message, no signs of struggle or forced entry. It will be sending documents to a client (through Http, its version 1.4 or thereabouts) and will just print the word “Killed”. the end. am back to my terminal prompt. if i try restarting it immediately, it reboots successfully. Only pattern i can figure out is that it only happens when there is a replication going on. it never happens with the gateway is idle.

could someone please tell me of the ghosts in my machine…and also how to set up alerts to know when it has died. like i said, no error messages, so the only way i know its died is when someone notices a lack of replication on their phone and i manually check gateway.

It sounds like the Linux kernel invoked the OOM Killer. Usually this affects databases and webservers, because they’re the one of the only processes running that is using a large amount of RAM.

You can verify that by checking dmesg:

dmesg | egrep -i “killed process”

Three possible options here:

Although these docs are for Couchbase Server, they apply to Sync Gateway as well. They suggest having a reasonable amount of virtual memory/swap space, even though the swappiness should be lowered to reduce how often it’s needed to be used.

thanks a million. doubling the RAM.