High CPU usage and latency problem

Eddie Kohler kohler at icir.org
Mon Mar 11 18:53:16 EST 2002


Hi Julian,

> 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.

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.)

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.

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?

Eddie



More information about the click mailing list