[tor-relays] Tor uses up all available memory and eventually quits

tor tor at anondroid.com
Sun Jan 28 06:14:11 UTC 2018


I think running on 1 GB of RAM with no swap is going to be difficult, especially if you have decent bandwidth and your node is busy.

You can create a small swap file on the existing file-system like so:

  sudo fallocate -l 1G /swapfile
  sudo chmod 600 /swapfile
  sudo mkswap /swapfile
  sudo swapon /swapfile

and to make permanent:

  echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

The swap file won't get used often, but will prevent your relay from going OOM and crashing. You can further reduce the likelihood of the swap getting used by setting something like "vm.swappiness = 10" in /etc/sysctl.conf.

Also these two entries in your torrc might help:

  DisableOOSCheck 0
  MaxMemInQueues 512 MB

​The first line will enable the "out of sockets" check, and although it aggressively drops connections, tends to prevent the node from falling over instead. The second reduces the amount of memory used.



More information about the tor-relays mailing list