[Click] _iters_per_os in routerthread
Ian Rose
ianrose at eecs.harvard.edu
Thu Mar 18 23:06:17 EDT 2010
Hi all -
In lib/routerthread.cc there is the following code:
#if CLICK_USERLEVEL
_iters_per_os = 64; /* iterations per select() */
#else
_iters_per_os = 2; /* iterations per OS schedule() */
#endif
I'm curious if there is a particular rationale behind the value 64 for
userlevel click. Is it simply the case that this value works pretty
well for most of the typical click configurations that were tested? In
my (admittedly brief) testing, it appears that this parameter choice
imposes a CPU overhead of ~3x for [some?] select-heavy applications, by
which I mean configs that spend most of their time calling selected() on
elements, rather executing tasks or timers. For example, my particular
app uses around 15-20% CPU with the above values, but if I change the 64
to a 2, the CPU usage drops to 5-6%.
Obviously this might simply be a case of the default parameters not
being particularly good for my specific situation, but I thought I'd
check since the performance difference seemed pretty significant.
cheers,
- Ian
More information about the click
mailing list