Re: (Fwd) Re: --enable-time-hack

From: Adrian Chadd <adrian@dont-contact.us>
Date: Fri, 8 Sep 2000 00:27:39 +0800

On Thu, Sep 07, 2000, Andres Kroonmaa wrote:

> access.log logs millisec times. to measure accurate time, we need to get
> current time exactly at the right measurement moment. for eg. when we accept
> http connection, and when we close client socket = time to service request.
> Anything inbetween can take some time. disk read/write ops can take several
> millisecs, disk open/close can take even more.
> If we stamp time only at the beginning of poll loop, and then service
> 20-100 sockets in a row, the last sockets would have quite inaccurate time.
>

Ok, I think that from a performance point of view, the behaviour here should
be tuneable. Ie, you either get coarse-grained accuracy, or fine-grained
accuracy. I'd be interested in this.

> I am quite worried about CPU usage of squid. My P3-800 box is doing about
> 100-150 reqs/sec and its CPU is very loaded. I can't see or find the
> source of CPU burning, gprof or other profiling tools are of little help,
> they all have only 10ms precision. I wonder if it makes sense to design
> a macro that could measure any func with very small overhead and very high
> precision. Solaris has got gethrtime() which returns nanosec time with
> CPU clocktick precision. It consults on-CPU counter. Most popular platforms
> do have something similar. It would be very useful to have cachemgr return
> stats table that shows where most of the CPU is burned. Then we could
> much better understand what needs more optimisation.

There are many, MANY places where CPU burn can be fixed. Try profiling
a kernel running squid - you'll see most of its time spent handling poll().
I've got a FreeBSD/kqueue squid running right now in the commloops branch
which I'm about to commit but it needs to lose the deferred-reads before
performance can really shine. After that, well, stuff like malloc/mempool
usage, the cbdata callback registry and HTTP parsing come to mind. Those
kind of things need to be optimised first.

Adrian

-- 
Adrian Chadd			"If a butterfly flaps its wings in China,
<adrian@creative.net.au>	    will a women get naked in Amsterdam?"
				      -- Ashley Penney on Chaos Theory
Received on Thu Sep 07 2000 - 10:27:47 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:36 MST