On 30 Sep 2016, at 14:37, Markus Koch niftybunny@googlemail.com wrote:
Installed with apt-get and started simply as a demon aka service tor start Thank you for helping
Have you tried:
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
2016-09-30 23:33 GMT+02:00 teor teor2345@gmail.com:
On 30 Sep 2016, at 14:01, Green Dream greendream848@gmail.com wrote:
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.
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
On Fri, Sep 30, 2016 at 02:48:38PM -0700, teor wrote:
Installed with apt-get and started simply as a demon aka service tor start Thank you for helping
Have you tried:
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...
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
tor-relays@lists.torproject.org