[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: signal newnym and rate limiting



On Mon, Jan 04, 2010 at 05:40:50AM -0600, Scott Bennett wrote:
>      On Mon, 04 Jan 2010 12:34:39 +0100 Nico Weinreich <info@xxxxxxxxxxxx>
> wrote:
> >Hi, in tor log I can see, that tor delayes sometimes the newnym signal. 
> >Is there a way to get this information (including the delayed time in 
> >seconds) trough control port after sending the newnym signal? Cheers
> 
>      I didn't know that tor could be so pokey about acknowledging input
> from the control port,

Actually, Tor is deliberately slow if you make newnym requests too close
together. No use spamming the network with new circuits all the time.

If you want to know whether your newnym has taken effect, you could watch
for circuit events and parse them, or watch for log events and parse them.

> but I've noted here in the past that tor often
> ignores a SIGHUP or SIGINT for a rather long period of time before finally
> accepting it.  I've seen delays well over a minute and approaching two
> minutes after sending tor either of those signals before it finally responds.
>      Why?  I have no idea.  The only way I know of to see the delay time
> is to watch the log file.

Hm. SIGHUP should respond quite quickly (well under a second). SIGINT
should log quite quickly, but on relays won't actually take down your
Tor relay for ShutdownWaitLength (typically 30) seconds.

If your log responses are taking minutes to show up, there's something
wrong. In fact, this problem sounds like the same problem you get around
"clock jumped" events. Is your libevent not waking up correctly each
second? What version of libevent are you using?

You could learn more by instrumenting the beginning of
second_elapsed_callback() in src/or/main.c to log when it starts:
  log_fn(LOG_NOTICE, "Tick.");
and instrumenting the bottom of that function with:
  log_fn(LOG_NOTICE, "End tick.");

"Tick" should show up slightly more than once per second -- not exactly
once per second due to bug 943:
https://bugs.torproject.org/flyspray/index.php?do=details&id=943
and "End tick" should show up quite soon (generally much less than a
second) after "Tick".

--Roger

***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxxx with
unsubscribe or-talk    in the body. http://archives.seul.org/or/talk/