Re: Chunked mempools, a first verdict

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Thu, 3 May 2001 18:31:50 +0200

On 3 May 2001, at 9:53, Alex Rousskov <rousskov@measurement-factory.com> wrote:

> On Thu, 3 May 2001, Andres Kroonmaa wrote:
>
> > Generally, probably yes. In this case, feeding NULL pointer in error
> > is not dangerous.
>
> It will not lead to a coredump, but it will consume more CPU cycles
> than the caller wanted it to. Personally, I do not see any _benefit_
> of overloading the function with two semantically different actions.
> To me, it is no different than another "switch" wrapper.

 right. And while Henrik is away, we are heading towards API with tons
 of exported symbols again ;) I don't know what to do, my overall coding
 experience isn't helpful here...
 You tell me, I'll do it.

> > There are 2 more issues to resolve: mempool lib is rudely importing
> > time_t squid_curtime to get HWmarks updated with time and to keep
> > track of chunk last reference time. Ideas welcome how to stop that.
> > Drop HWmark times altogether?
> >
> > Another issue is added by myself. To get rate/sec for each pool
> > allocations I'm saving alloc counter each time memReport is called.
> > Saving it to MemPoolMeter struct itself, ie. into library's space.
> > By all means this is dirty, but then again, it was quick ;)
> > I personally find it useful to see in the cachemgr output what types
> > of pools get most memory traffic. It returns allocs/sec since last
> > memReport output. Your opinions?
>
> How about calling a memPoolUpdateTime(time_t) function from Squid
> every time time changes (or once in a while)?

 This sounds kind of weird if you look at it from a perspective that
 this is just a memory allocator. libmalloc, and UpdateTime?? ;-)
 Probably then it would make more sense to ask OS for time internally,
 say every 1K-100K alloc calls?

> I think reporting allocations rate is great.
>
> I do not like "since last memReport output" approach because lots of
> scripts and humans may ask Squid for that report. We cannot assume
> that there is only one "user" of the report. For example, all Duane's
> caches have scripts polling them for stats every 5 minutes or so;
> if you happen to get stats shortly after that event, you counters will
> be wrong.

 Not wrong, but averaged over a shorter timeframe than expected.
 I thought mempool stats are mostly for people, developers and alike.
 If you are the only user, then such approach is lovely because you can
 pick the "averaging" timeframe by your browser's refresh button.
 And if you have scripts doing periodic polls, then probably from them
 you'd get much better idea about the rates and all.

 Send javascript to the browser so it calculates the rates? ;)

> I would suggest that allocation rate stats are maintained by memPool
> library using the memPoolUpdateTime() approach above.

 Then we are right into arguing what time averages to keep, and how
 to present them decently.
 Could also configure averaging time in squid.conf and let periodic
 cleanup event do the checkpointing.

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 CTO, Delfi Online
 Tel: 6501 731, Fax: 6501 708
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Thu May 03 2001 - 10:36:24 MDT

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