Re: [PATCH] schedule connect timeouts via eventAdd

From: Rainer Weikusat <rweikusat_at_mobileactivedefense.com>
Date: Thu, 24 Jan 2013 19:51:43 +0000

Alex Rousskov <rousskov_at_measurement-factory.com> writes:
> On 01/24/2013 11:16 AM, Rainer Weikusat wrote:
>>> * there are well-justified concerns about RAM or performance overhead of
>>> event-based timeouts with the current event queue,
>>
>> The concern I originally wrote about was whether it would be better to
>> let the event-based timeout expire or to cancel it instead. The 'RAM
>> overhead' of using the event queue would be the memory needed for an
>> ev_entry object. That's 48 bytes, compared to the size of the
>> ConnOpener object figuring at 112 bytes.
>
> For add-and-forget, the RAM overhead is not a few bytes per ConnOpener
> object because those events stay in the queue a lot longer than
> ConnOpener objects stay alive. With 60'000 alive events, the RAM
> overhead concern is justified.
>
> For add-and-delete, there is justified CPU overhead (and no RAM
> overhead) IMO.

This would speak in favor of removing the entries, then. As I wrote in
my previous e-mail, I'm, apart from that, convinced that the
linked-list implementation will be good enough because of 'experience'
and (independently of that), I don't think it should be discarded as
'not good enough' based on assumptions alone.

[...]

> Please give me a few hours to implement initial fd-based ConnOpener
> changes so that we can discuss a specific alternative to event queue
> optimizations.

There's no need for event queue 'optimizations' at the moment and - as
I wrote in my previous e-mail - should such optimization become
necessary, they are easily implemented, and it would also be possible
to just use the STL implementation instead. Priority queues are not
exactly rocket science. OTOH, using the fd table based approach would
require some relatively ugly hacks.

As a slight head start, below is a fix for the 'timeout
not defused after ::connect,

-----------------
--- mad-squid-timeout/src/comm/ConnOpener.cc 21 Jan 2013 16:48:02 -0000 1.1.1.2.6.4
+++ mad-squid-timeout/src/comm/ConnOpener.cc 24 Jan 2013 19:47:55 -0000
@@ -202,6 +202,8 @@
 void
 Comm::ConnOpener::connected()
 {
+ fd_table[temporaryFd_].timeoutHandler = NULL;
+ fd_table[temporaryFd_].timeout = 0;
     conn_->fd = temporaryFd_;
     temporaryFd_ = -1;
-----------------

I have no interest in hacking up the 'connect_retries' thing again
because I don't need this feature right at the moment.
Received on Thu Jan 24 2013 - 19:52:00 MST

This archive was generated by hypermail 2.2.0 : Fri Jan 25 2013 - 12:00:09 MST