<div>I am running Debian Jesse that was recommended by the Tor docs.  As I remember, some part of an install script reset my file limits to 65536, which is what I get with:<br></div><div>ulimit -n<br></div><div>I have never had to think about this, but I'm not running anything big; I have about  2500 - 3000 connections, but I'm offering this number, as it was not set by me, but by wiser minds than mine.<br></div><div><br></div><div><br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-user protonmail_signature_block-empty"><br></div><div class="protonmail_signature_block-proton">Sent with <a href="https://protonmail.com">ProtonMail</a> Secure Email.<br></div></div><div><br></div><blockquote class="protonmail_quote" type="cite"><div>-------- Original Message --------<br></div><div>Subject: Re: [tor-relays] Too many connections warning<br></div><div>Local Time: December 7, 2017 10:46 AM<br></div><div>UTC Time: December 7, 2017 3:46 PM<br></div><div>From: r1610091651@telenet.be<br></div><div>To: tor-relays@lists.torproject.org<br></div><div><br></div><div dir="ltr"><div>Hi<br></div><div><br></div><div>I think tor already has 32k open files limit, hence the error. Just to make sure, try this:<br></div><div><br></div><div>cat /proc/`cat /run/tor/tor.pid`/limits<br></div><div><br></div><div>Notice the line with "Max open files"<br></div><div><br></div><div>Depending on how tor is started, you might need to change the config:<br></div><div>with systemd<br></div><div>  /lib/systemd/system/tor@default.service:<br></div><div>      LimitNOFILE=xxxxx     <= change this<br></div><div>with init<br></div><div>  /etc/security/limits.conf:<br></div><div>      *                soft    nofile          8192<br></div><div>      *                hard    nofile          32768<br></div><div>      that one can be change /user (username), /group, ... or for all users (*)<br></div><div><br></div><div>Bye<br></div></div><div><br></div><div class="gmail_quote"><div dir="ltr">On Thu, 7 Dec 2017 at 16:25 Tyler Johnson <<a href="mailto:tylrcjhnsn@gmail.com">tylrcjhnsn@gmail.com</a>> wrote:<br></div><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" class="gmail_quote"><div dir="auto"><div>I believe this warning describes a lack of available file descriptors, limiting the amount of connections your tor relay is able to make.<br></div><div dir="auto"><br></div><div dir="auto">ulimit -n is exactly the command you want to use to raise that limit from your current 1024. <br></div><div dir="auto"><br></div><div dir="auto">What exactly that number should be, I couldn't say, but you could start at 10000 and raise / lower based on your needs and resources.<br></div><div dir="auto"><br></div><div dir="auto">Raising a similar limit on OpenBSD from the default to 20000 helped eliminate the error for me.<br></div><div dir="auto"><br></div><div dir="auto"><br></div></div><div class="gmail_extra"><div><br></div><div class="gmail_quote"><div>On Dec 7, 2017 7:28 AM, "Logforme" <<a href="mailto:m7527@abc.se">m7527@abc.se</a>> wrote:<br></div><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" class="gmail_quote"><div>I run the non-exit relay Logforme (855BC2DABE24C861CD887DB9B2E950424B49FC34).<br></div><div> <br></div><div> Today I saw a new warning in my tor log file:<br></div><div> Dec 07 09:48:12.000 [warn] Failing because we have 32735 connections already. Please read doc/TUNING for guidance.<br></div><div> <br></div><div> The relay runs on an old Debian Wheezy machine. Me being a Linux noob I tried to read the doc/TUNING document (<a rel="noreferrer" href="https://gitweb.torproject.org/tor.git/tree/doc/TUNING">https://gitweb.torproject.org/tor.git/tree/doc/TUNING</a>) but the only information I deemed suitable for me was "Use ulimit -n", which I ran and it reported "1024". I guess that's not of interest for this warning.<br></div><div> <br></div><div> Over the years I have added some stuff to my sysctl.conf file that I have picked up. Don't remember from where:<br></div><div> # Tor<br></div><div> net.core.rmem_max = 33554432<br></div><div> net.core.wmem_max = 33554432<br></div><div> net.ipv4.tcp_rmem = 4096 87380 33554432<br></div><div> net.ipv4.tcp_wmem = 4096 65536 33554432<br></div><div> net.core.rmem_default = 524287<br></div><div> net.core.wmem_default = 524287<br></div><div> net.core.optmem_max = 524287<br></div><div> net.core.netdev_max_backlog = 300000<br></div><div> net.ipv4.tcp_mem = 33554432 33554432 33554432<br></div><div> net.ipv4.tcp_max_orphans = 300000<br></div><div> net.ipv4.tcp_max_syn_backlog = 300000<br></div><div> net.ipv4.tcp_fin_timeout = 4<br></div><div> vm.min_free_kbytes = 65536<br></div><div> net.ipv4.tcp_keepalive_time = 60<br></div><div> net.ipv4.tcp_keepalive_intvl = 10<br></div><div> net.ipv4.tcp_keepalive_probes = 3<br></div><div> net.ipv4.ip_local_port_range = 1025 65530<br></div><div> net.core.somaxconn = 30720<br></div><div> net.ipv4.tcp_max_tw_buckets = 2000000<br></div><div> net.ipv4.tcp_timestamps = 0<br></div><div> net.ipv4.tcp_challenge_ack_limit = 999999999<br></div><div> <br></div><div> None of the values seem to match the 32735 mentioned in the warning so I'm at a loss for what I am supposed to change.<br></div><div> Anyone knowledgeable of these things that can give me some pointers?<br></div><div> <br></div><div> <br></div><div> _______________________________________________<br></div><div> tor-relays mailing list<br></div><div> <a href="mailto:tor-relays@lists.torproject.org">tor-relays@lists.torproject.org</a><br></div><div> <a rel="noreferrer" href="https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays">https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays</a><br></div></blockquote></div></div><div>_______________________________________________<br></div><div> tor-relays mailing list<br></div><div> <a href="mailto:tor-relays@lists.torproject.org">tor-relays@lists.torproject.org</a><br></div><div> <a rel="noreferrer" href="https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays">https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays</a><br></div></blockquote></div></blockquote><div><br></div>