High CPU usage and latency problem

julian at precisium.com.au julian at precisium.com.au
Tue Mar 12 03:29:33 EST 2002


>
> > I'm running user level CLICK 1.2.3 on FreeBSD 4.4 on a 1.2GHZ CPU.
> > After a minute or two of running, I get extremely large and variable
> > latencies - up to thousands of ms. The router is being used on an ADSL
link
> > and is generally only dealing with a few hundred Kbps.
> > I tried simplifying my config but nothing seemed to fix it.
> >
> > The CPU usage seems to hit about 99% after roughly 90 seconds of
running.
> > This happens even with a bare config containing just an AddressInfo
element.
>
> So the configuration contains no elements that are talking to the network?
> Wow.

Yeah, I figured that was a fairly simple config :)

>
> The Click program can be a CPU hog, taking as much CPU as it can get,
> running in a busy loop. It sounds like this might be causing the problem
> you're experiencing. One way to find out might be to add an element that
> waited for a while -- like did a usleep(100) every time it was scheduled.
> (You'd have to write this element.)

Ok - thanks, I'll try to do some experimenting some time, though writing
something in C++ is a bit of a stretch for me.

>
> What about the configuration 'FromDevice(...) -> Discard' on an idle
> network? This should do a select() call on the BPF file descriptor, so
> Click should not take up tons of CPU.

You're right - that works fine even doing that on a couple of interfaces and
with the usual activity on the network.


>
> Oh, and the most obvious question. Why does the CPU hit 99%? Are you sure
> Click is to blame, or is it the kernel? What does `top` say?

'top' is what I was using.  It says 0.00% (or near to it) for everything
except click which on even the simple 'addressinfo' config sits up there
running 98% or more for WCPU & CPU

It's entirely possible I've done something heinous in my kernel config as
I'm new to FreeBSD and in fact to anything unix-like.  I'll play around with
a few things.

Cheers,
Julian

>
> Eddie
>




More information about the click mailing list