Hi -
> [...]
> > >100 lines, and not done yet. We need a higher level API that
> > combines the lookup/indom/fetch/extract/scale steps (doing internal
> > caching/lookups as necessary), with the goal of making it easy to
> > interface with an enclosing application.
>
> Helper APIs would be good in general terms, bonus points for using
> 'em in existing tools (and extracting code used from tools wherever
> possible/needed instead of starting from scratch).
Sure.
> Doing libpcp-internal caching is non-trivial. [...]
Indeed, but it does seem time to try.
> [...] Having looked at the pmwebd code again recently, it's crying
> out for help with caching - its not making ideal use of the PCP
> protocol at the moment (doing descriptor lookups in a loop for every
> pmFetch & that sort of thing). [...]
On the pmwebapi side (pmwebapi_respond_metric_fetch, apprx. no
looping), that's right. On the pmgraphite side, where tight pmFetch
loops exist, no.
> > - Multithreaded support has had long-known bugs that preclude their
> > heavy-duty use in a real application (pmwebd / graphite), even for
> > just archives. It turns out that for light-duty use, there is not
> > enough support either. For the cockpit application, we might like
> > to use PM_CONTEXT_LOCAL, but that is precluded for multithreaded
> > apps. PM_CONTEXT_HOST to local: is fine in theory, but due to the
> > single-threadedness of pmcd, it snuffs out any possible advantage
>
> Hmmm, there may be some leaps of logic there - I'd like to see more
> measuring to verify the need for some of this (the "snuffs out any
> advantage" bit, in particular, I could use more details/verification
> there to be more convinced).
It's just first principles. cockpitd is multithreaded, and can handle
multiple requests at the same time from its client. If it were to
relay those concurrent requests to PCP, it will be blocked (at the
PM_CONTEXT_LOCAL level by errors), or serialized (at the
PM_CONTEXT_HOST pmcd level). There will be latency instead of
concurrency, whatever the exact measured amount.
- FChE
|