Hi, Ken -
> Does not necessarily require any additional cacheing ... I was suggest
> an algorithmic change, from
> [...]
> traverse pmns
> salt away each metric of interest
> foreach metric of interest
> skip metric if already done
> get metadata
> process this _and_ all other metrics with the same indom
That could work too, though doing it naively could involve O(#metrics**2)
iteration, which could itself be heavy. Doing it the cache way in pmwebd
turned out to be easy:
git://sourceware.org/git/pcpfans.git fche/pmwebd
commit 001ea046aa3701faaabb1d99b69d40294e33174e
Author: Frank Ch. Eigler <fche@xxxxxxxxxx>
Date: Mon Jul 27 20:17:39 2015 -0400
pmwebd graphite mode: elide repeated indom searching
It was reported that for some larger archives, pmwebd was taking
noticable time running pmGetInDomArchive. This effort was being
repeated for every metric, whereas it could be reused across metrics
with the same indom. We now do this by memoizing the wildcard-filtered
instance names during pmns iteration. (The cache is thrown away after
pmns traversal.)
There are no intended changes in visible behavior except for speedup;
previous QA is sufficient.
- FChE
|