Discussion:
[tor-relays] help #3
Markus Koch
2016-09-30 03:05:21 UTC
Permalink
me again ... I need the knowledge of the almighty tor operators.

I set up three new and shiny tor exists and got a not so shiny error message:

[WARN]Failing because we have 4063 connections already. Please read
doc/TUNING for guidance

It was already in this mailing list:

http://archives.seul.org/tor/relays/Feb-2016/msg00060.html

I "tuned" it with ulimit https://gitweb.torproject.org/tor.git/tree/doc/TUNING/

and nothing works and now I am running out of ideas and getting
pissed. They exits are running a Debian 7 x64 minimal install with the
newest tor version.

Any ideas how to fix it?

Markus
David S
2016-09-30 12:46:43 UTC
Permalink
Post by Markus Koch
me again ... I need the knowledge of the almighty tor operators.
[WARN]Failing because we have 4063 connections already. Please read
doc/TUNING for guidance
http://archives.seul.org/tor/relays/Feb-2016/msg00060.html
I "tuned" it with ulimit https://gitweb.torproject.org/tor.git/tree/doc/TUNING/
and nothing works and now I am running out of ideas and getting
pissed. They exits are running a Debian 7 x64 minimal install with the
newest tor version.
Any ideas how to fix it?
Markus
_______________________________________________
tor-relays mailing list
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays
is this running inside OpenVZ virtualization? if so, check the archives
of this list. i had the same problem a few days ago.
cat /proc/user_beancounters
Markus Koch
2016-09-30 14:07:40 UTC
Permalink
Thx, already thought about this and its not :(

Markus
Post by Markus Koch
me again ... I need the knowledge of the almighty tor operators.
[WARN]Failing because we have 4063 connections already. Please read
doc/TUNING for guidance
http://archives.seul.org/tor/relays/Feb-2016/msg00060.html
I "tuned" it with ulimit
https://gitweb.torproject.org/tor.git/tree/doc/TUNING/
and nothing works and now I am running out of ideas and getting
pissed. They exits are running a Debian 7 x64 minimal install with the
newest tor version.
Any ideas how to fix it?
Markus
_______________________________________________
tor-relays mailing list
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays
is this running inside OpenVZ virtualization? if so, check the archives of
this list. i had the same problem a few days ago.
cat /proc/user_beancounters
_______________________________________________
tor-relays mailing list
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays
Green Dream
2016-09-30 21:01:14 UTC
Permalink
Have you double-checked the ulimit was applied correctly? Including
making sure it's applied to the user account running Tor? Here's how I
do that on Ubuntu/Debian, assuming the user account is "debian-tor":

sudo su debian-tor --shell /bin/bash --command "ulimit -Sn"
sudo su debian-tor --shell /bin/bash --command "ulimit -Hn"

Those should return the actual hard and soft limits being applied to
the debian-tor user. In my case it returns 64000, but you'll just want
to make sure it's what you're expecting.
Post by Markus Koch
nothing works and now I am running out of ideas
It would be easier for people to help if you elaborate a bit --
perhaps the exact commands you've already tried and the log messages
(if there are any other error or warning messages besides the one you
already listed).
teor
2016-09-30 21:33:13 UTC
Permalink
Post by Green Dream
Have you double-checked the ulimit was applied correctly? Including
making sure it's applied to the user account running Tor? Here's how I
sudo su debian-tor --shell /bin/bash --command "ulimit -Sn"
sudo su debian-tor --shell /bin/bash --command "ulimit -Hn"
Those should return the actual hard and soft limits being applied to
the debian-tor user. In my case it returns 64000, but you'll just want
to make sure it's what you're expecting.
Post by Markus Koch
nothing works and now I am running out of ideas
It would be easier for people to help if you elaborate a bit --
perhaps the exact commands you've already tried and the log messages
(if there are any other error or warning messages besides the one you
already listed).
The debian packages should set the appropriate file descriptors for you.
How are you launching your tor services?

T

--
Tim Wilson-Brown (teor)

teor2345 at gmail dot com
PGP C855 6CED 5D90 A0C5 29F6 4D43 450C BA7F 968F 094B
ricochet:ekmygaiu4rzgsk6n
xmpp: teor at torproject dot org
teor
2016-09-30 21:48:38 UTC
Permalink
Installed with apt-get and started simply as a demon aka service tor start
Thank you for helping
Post by teor
Post by Green Dream
sudo su debian-tor --shell /bin/bash --command "ulimit -Sn"
sudo su debian-tor --shell /bin/bash --command "ulimit -Hn"
What are the file descriptor limits set to?
How much RAM does the system have?
What are the TCP buffer limits in the kernel?

Here's some background:

In Tor, there are the 4 C/Linux error return values that can
trigger that message:
EMFILE
ENFILE
ENOBUFS
ENOMEM

On my system, "man 2 intro" lists them as:

Too many open files...the limit on the number of
open files per process...

Too many open files in system. Maximum number of file descrip-
tors allowable on the system has been reached...

No buffer space available. An operation on a socket or pipe
was not performed because the system lacked sufficient buffer
space or because a queue was full.

Cannot allocate memory. The new process image required more
memory than was allowed by the hardware or by system-imposed mem-
ory management constraints


T
Markus
Post by teor
Post by Green Dream
Have you double-checked the ulimit was applied correctly? Including
making sure it's applied to the user account running Tor? Here's how I
sudo su debian-tor --shell /bin/bash --command "ulimit -Sn"
sudo su debian-tor --shell /bin/bash --command "ulimit -Hn"
Those should return the actual hard and soft limits being applied to
the debian-tor user. In my case it returns 64000, but you'll just want
to make sure it's what you're expecting.
Post by Markus Koch
nothing works and now I am running out of ideas
It would be easier for people to help if you elaborate a bit --
perhaps the exact commands you've already tried and the log messages
(if there are any other error or warning messages besides the one you
already listed).
The debian packages should set the appropriate file descriptors for you.
How are you launching your tor services?
T
--
Tim Wilson-Brown (teor)
teor2345 at gmail dot com
PGP C855 6CED 5D90 A0C5 29F6 4D43 450C BA7F 968F 094B
ricochet:ekmygaiu4rzgsk6n
xmpp: teor at torproject dot org
T

--
Tim Wilson-Brown (teor)

teor2345 at gmail dot com
PGP C855 6CED 5D90 A0C5 29F6 4D43 450C BA7F 968F 094B
ricochet:ekmygaiu4rzgsk6n
xmpp: teor at torproject dot org
Roger Dingledine
2016-10-02 20:47:20 UTC
Permalink
Installed with apt-get and started simply as a demon aka service tor start
Thank you for helping
Post by Green Dream
sudo su debian-tor --shell /bin/bash --command "ulimit -Sn"
sudo su debian-tor --shell /bin/bash --command "ulimit -Hn"
I think these commands won't help you and might be a distraction --
if you're using the Tor deb, it will set your ulimits for you as part
of the initscript:
https://gitweb.torproject.org/debian/tor.git/tree/debian/tor.init#n40
So even if debian-tor's ulimits are set low (or heck, set high), the
init script will still set them itself when you launch Tor.

That said, the number your Tor said makes me suspicious:
"Failing because we have 4063 connections already."

Tor 0.2.7.x and 0.2.8.x keep 32 sockets in reserve:
https://gitweb.torproject.org/tor.git/tree/src/common/compat.c?h=release-0.2.8#n1658

So it really looks like your ulimit -n is set to 4096.

But 4096 isn't one of the numbers that the Debian init script picks!

Nice mystery you have here.

The thread you quoted earlier has some good hints:
http://archives.seul.org/tor/relays/Feb-2016/msg00060.html

So do a "pidof tor" and it will tell you the processID number(s) of
your Tor process(es), and then look in /proc/PID/limits where PID is
the processID number.

I'm guessing you will see a line like

Max open files 65536 65536 files

But it will say 4096 instead?

And then my question for you would be "are you super sure that you're
really starting the Tor service using the debian initscript?" You're
starting it as root (or with sudo), yes?

--Roger

Continue reading on narkive:
Loading...