[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: Unable to start Tor in Cygwin
Nick Mathewson wrote:
> On Mon, Aug 21, 2006 at 08:32:23PM +0800, Pei Hanru wrote:
>> I complied Tor in Cygwin successfully, but when trying to start Tor, I
>> got the following messages and Tor exits.
>> Aug 21 20:23:55.890 [notice] Tor v0.1.2.0-alpha-cvs. This is
>> experimental software. Do not rely on it for strong anonymity.
>> Aug 21 20:23:55.905 [notice] Initialized libevent version 1.1b using
>> method poll. Good.
>> Aug 21 20:23:55.905 [warn] set_max_file_descriptors(): Could not set
>> maximum number of file descriptors: Too many open files
>> Aug 21 20:23:55.905 [warn] Failed to parse/validate config: Problem with
>> ConnLimit value. See logs for details.
>> Aug 21 20:23:55.905 [err] tor_init(): Reading config failed--see
>> warnings above.
>> I also tried to start Tor with the option ConnLimit, such as "tor
>> ConnLimit 100", but still failed...
>> Dos anybody here know where the problem is? Any hint? Thanks in advance.
> I'm afraid I don't have a cygwin setup handy, so I can only explain
> what Tor is doing here. Tor is calling Cygwin's setrlimit function to
> change the maximum number of file descriptors (RLIMIT_NOFILE). It
> looks like this call is failing with EMFILES. This shouldn't happen,
> since we don't raise the value any higher than the hard limit. I'd
> suspect a Cygwin limitation.
> Googling shows that this has been a problem with _at least some_
> versions of Cygwin:
> Does this problem occur with the latest cygwin builds?
I think I've traced where the problem is. Cygwin *does* have a
limitation on the number of RLIMIT_NOFILE, if the soft limit is set to
be larger than 3200, setrlimit returns with the error "Too many open
files". But Tor defines MAXCONNECTIONS 15000, which is passed to
setrlimit and is much larger than 3200. See
I've rebuilt Tor definning MAXCONNECTIONS 3200, now everything is OK. :)
Will 3200 enough, for a client or a slow server?