Hello,
I have a VPS with 512 MB RAM. I run nothing on it except nginx and a Tor relay. The relay is an entry guard and moves about 20 MB/s. It seems that the kernel is killing the Tor process with "out of memory" errors. Are there any tips for mitigating this? I don't have the money right now to upgrade to the next higher VPS plan which has more RAM, unfortunately. Maybe there's some config settings that I can modify to limit the RAM usage? Or, am I just out of luck?
Thanks, Steve
On Thu, 25 Feb 2016 18:19:44 -0500 Stephen R Guglielmo srguglielmo@gmail.com wrote:
Hello,
I have a VPS with 512 MB RAM. I run nothing on it except nginx and a Tor relay. The relay is an entry guard and moves about 20 MB/s. It seems that the kernel is killing the Tor process with "out of memory" errors. Are there any tips for mitigating this? I don't have the money right now to upgrade to the next higher VPS plan which has more RAM, unfortunately. Maybe there's some config settings that I can modify to limit the RAM usage? Or, am I just out of luck?
If you VPS is based on KVM, Xen or VMware (i.e. not the container-based OpenVZ), you could add some swap space. But if it gets used too hard, you risk getting warned or terminated by your VPS provider for disk I/O abuse. And of course some performance degradation will occur as soon as Tor doesn't fit entirely into RAM and has to use the swap.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
This happend before with my 512MB node, when it was set unlimited amount of Mbit/sec. Also swap might help.
On February 26, 2016 12:19:44 AM GMT+01:00, Stephen R Guglielmo srguglielmo@gmail.com wrote:
Hello,
I have a VPS with 512 MB RAM. I run nothing on it except nginx and a Tor relay. The relay is an entry guard and moves about 20 MB/s. It seems that the kernel is killing the Tor process with "out of memory" errors. Are there any tips for mitigating this? I don't have the money right now to upgrade to the next higher VPS plan which has more RAM, unfortunately. Maybe there's some config settings that I can modify to limit the RAM usage? Or, am I just out of luck?
Thanks, Steve
tor-relays mailing list tor-relays@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays
- -- PGP : 29A4CE52
I'm unfamiliar with the memory use of nginx, but 512MB ought to be more than enough RAM to run just the relay on a 64-bit VPS..
Are you *sure* you're not running anything else? Not crond? Not ntpd? Not iptables? If not SSH, how do you administer the VPS?
What type of virtualization is the VPS using? If not OpenVZ, make sure you have virtual memory on the system. You can create a swapfile if don't already have a swap partition.
Do you have SELinux enabled in the VPS? if so, get rid of it.
Finally, you may have to ditch nginx and just use Tor and the system utilities to monitor performance.
On 02/25/2016 06:19 PM, Stephen R Guglielmo wrote:
Hello,
I have a VPS with 512 MB RAM. I run nothing on it except nginx and a Tor relay. The relay is an entry guard and moves about 20 MB/s. It seems that the kernel is killing the Tor process with "out of memory" errors. Are there any tips for mitigating this? I don't have the money right now to upgrade to the next higher VPS plan which has more RAM, unfortunately. Maybe there's some config settings that I can modify to limit the RAM usage? Or, am I just out of luck?
On Fri, 26 Feb 2016 08:05:06 -0500 Steve Snyder swsnyder@snydernet.net wrote:
I'm unfamiliar with the memory use of nginx, but 512MB ought to be more than enough RAM to run just the relay on a 64-bit VPS..
Are you *sure* you're not running anything else? Not crond? Not ntpd? Not iptables? If not SSH, how do you administer the VPS?
IPTables is configured, but no firewall daemon is running. NTPd is not running (I've tried, but the kernel does not have permission to set the clock; I assume this is due to the hypervisor setup). SSH is not running. I have console access through the control panel. Cron and rsyslog are running. I didn't include them in my original post because assumed that others would assume they'd be running since they're quite common and regular system daemons.
Here's a full output of `ps aux` that I just ran (it's not very long): https://gist.github.com/srguglielmo/63290d10b1bba434c77d
What type of virtualization is the VPS using? If not OpenVZ, make sure you have virtual memory on the system. You can create a swapfile if don't already have a swap partition.
It uses KVM. It doesn't currently have swap space, so I'll add a swapfile for the system to use. Hopefully this will solve the problem.
Do you have SELinux enabled in the VPS? if so, get rid of it.
I'll double check this and make sure to disable it if enabled. Thanks!
Finally, you may have to ditch nginx and just use Tor and the system utilities to monitor performance.
Some additional information. Here's the out-of-memory errors I've been seeing in /var/log/messages. https://gist.github.com/srguglielmo/e2693513e3502a0d5196
It seems that systemd restarts Tor whenever it's killed.
`free -m`: total used free shared buff/cache available Mem: 489 303 16 8 169 124 Swap: 0 0 0
I'll look into enabling swap and ensuring SELinux is disabled. Hopefully that will help. Thank you!
On 02/25/2016 06:19 PM, Stephen R Guglielmo wrote:
Hello,
I have a VPS with 512 MB RAM. I run nothing on it except nginx and a Tor relay. The relay is an entry guard and moves about 20 MB/s. It seems that the kernel is killing the Tor process with "out of memory" errors. Are there any tips for mitigating this? I don't have the money right now to upgrade to the next higher VPS plan which has more RAM, unfortunately. Maybe there's some config settings that I can modify to limit the RAM usage? Or, am I just out of luck?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Stephen R Guglielmo:
NTPd is not running (I've tried, but the kernel does not have permission to set the clock; I assume this is due to the hypervisor setup).
Hhm, ntp should be able to set the unix time for and within your virtual machine. It's more likely not allowed to write to hwclock during shutdown.
- -- Toralf PGP: C4EACDDE 0076E94E, OTR: 420E74C8 30246EE7
On Fri, 26 Feb 2016 22:56:05 +0000 Toralf Förster toralf.foerster@gmx.de wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Stephen R Guglielmo:
NTPd is not running (I've tried, but the kernel does not have permission to set the clock; I assume this is due to the hypervisor setup).
Hhm, ntp should be able to set the unix time for and within your virtual machine. It's more likely not allowed to write to hwclock during shutdown.
Ah, you're right. I was thinking of my other VPS with OpenVZ. It gives me a "permission denied" when the date is set (even as root). I'll get OpenNTPd going on there right away.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Hello,
More information is needed.
Please indicate the type of virtualization used (VMware, Xen, KVM, OpenVZ), your operating system and Tor version as well as the "out of memory" log messages you mentioned - are these from kernel logs or Tor's log?. Setting Tor's log level to debug mode or info mode could also help.
On 2/26/2016 1:19 AM, Stephen R Guglielmo wrote:
Hello,
I have a VPS with 512 MB RAM. I run nothing on it except nginx and a Tor relay. The relay is an entry guard and moves about 20 MB/s. It seems that the kernel is killing the Tor process with "out of memory" errors. Are there any tips for mitigating this? I don't have the money right now to upgrade to the next higher VPS plan which has more RAM, unfortunately. Maybe there's some config settings that I can modify to limit the RAM usage? Or, am I just out of luck?
Thanks, Steve
clearing the memory cache with a cron job cant hurt
On Thu, Feb 25, 2016 at 6:19 PM, Stephen R Guglielmo srguglielmo@gmail.com wrote:
Hello,
I have a VPS with 512 MB RAM. I run nothing on it except nginx and a Tor relay. The relay is an entry guard and moves about 20 MB/s. It seems that the kernel is killing the Tor process with "out of memory" errors. Are there any tips for mitigating this? I don't have the money right now to upgrade to the next higher VPS plan which has more RAM, unfortunately. Maybe there's some config settings that I can modify to limit the RAM usage? Or, am I just out of luck?
Thanks, Steve
tor-relays mailing list tor-relays@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays
On Fri, Feb 26, 2016 at 04:03:14PM -0500, Steven Jones wrote:
clearing the memory cache with a cron job cant hurt
Yes it can. There is no reason to clear the vm cache manually unless you are testing cache-related code paths. The kernel will automatically reclaim cache memory for program memory should the need arise, and uses the otherwise idle/free memory for disk cache. Clearing cache will only degrade the performance of your machine while the cached material is re-read from disk.
--Sean
echo 3 | tee /proc/sys/vm/drop_caches
On Thu, Feb 25, 2016 at 6:19 PM, Stephen R Guglielmo srguglielmo@gmail.com wrote:
Hello,
I have a VPS with 512 MB RAM. I run nothing on it except nginx and a Tor relay. The relay is an entry guard and moves about 20 MB/s. It seems that the kernel is killing the Tor process with "out of memory" errors. Are there any tips for mitigating this? I don't have the money right now to upgrade to the next higher VPS plan which has more RAM, unfortunately. Maybe there's some config settings that I can modify to limit the RAM usage? Or, am I just out of luck?
Thanks, Steve
tor-relays mailing list tor-relays@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays
On 26.02.2016 00:19, Stephen R Guglielmo wrote:
I have a VPS with 512 MB RAM. [...] The relay is an entry guard and moves about 20 MB/s.
Is that really 20 MegaByte per second?
If so, I fear 512 MB RAM won't cut it.
According to my experience, for a 100 Mbit/s relay you need at least 1 GB RAM.
On 02/26/2016 11:22 PM, Random Tor Node Operator wrote:
I have a VPS with 512 MB RAM. [...] The relay is an entry guard and moves about 20 MB/s.
Is that really 20 MegaByte per second? If so, I fear 512 MB RAM won't cut it. According to my experience, for a 100 Mbit/s relay you need at least 1 GB RAM.
Yes, that is also my experience.
tor-relays@lists.torproject.org