Red Hat Bugzilla – Bug 1205231
RFE: provide IPVS/LVS metrics
Last modified: 2017-08-23 11:11:43 EDT
Created attachment 1005859 [details] ip_vs_stats Description of problem: It would be nice if PCP could provide some IPVS/LVS metrics/statistics. Although the most often used user space component has changed (from Piranha/pulse to keepalived) the kernel proc interface has remained stable for a number of years. The files are /proc/net/ip_vs* and it'd be easy to setup a test environment (e.g. one director and one real server) as described at http://www.linuxvirtualserver.org/docs/ha/keepalived.html. For convenience I'm attaching ip_vs_stats which might be all what would need to be covered.
Hi Marko, From a look through the kernel code, we're talking about stats exporting from net/netfilter/ipvs/ip_vs_ctl.c::ip_vs_stats_show (amongst others). There is a netfilter PMDA someone began awhile back which could be extended to handle this, perhaps. Or they could live in pmdalinux. Or they might be suited to the specialist networking PMDA Michele has been working on. Quickest will probably be to add it to the perl netfilter PMDA I guess... anyone have any preferences here? The stats output you've given there is very helpful, thanks Marko - interesting that these counters are exported in hex (!) - first time I've ever seen that - and for PCP's needs we really just need that first row of values. The second row contains constantly updating 2-second timer-based rate converted values - which we can do more effectively in userspace, without loss of information. Comment toward the head of ip_vs_est.c (which houses ip_vs_read_estimator(), from whence the second line is calculated) is spot on - "it is easy to implement a user level daemon which periodically reads those statistical counters and measure rate." :) cheers.
Thanks for looking into this. I think any of those PMDAs would do just fine but perhaps the netfilter PMDA would be my least preferred choice as it's a different subsystem. Also, the other related proc files (ip_vs, ip_vs_app, ip_vs_conn, ip_vs_conn_sync) contain information about current rules and current connections but I'm not sure are those worth to add. Thanks.
(In reply to Marko Myllynen from comment #2) > Thanks for looking into this. I think any of those PMDAs would do just fine > but perhaps the netfilter PMDA would be my least preferred choice as it's a > different subsystem. Hmm, the location of the kernel code net/netfilter/ipvs/ip_vs_ctl.c::ip_vs_stats_show ^^^^^^^^^^^^^' suggested otherwise - no big deal though, those other options are fine too. Also, the other related proc files (ip_vs, ip_vs_app, > ip_vs_conn, ip_vs_conn_sync) contain information about current rules and > current connections but I'm not sure are those worth to add. Not sure - could you add sample output from a working setup just in case? thanks Marko.
(In reply to Nathan Scott from comment #3) > (In reply to Marko Myllynen from comment #2) > > Thanks for looking into this. I think any of those PMDAs would do just fine > > but perhaps the netfilter PMDA would be my least preferred choice as it's a > > different subsystem. > > Hmm, the location of the kernel code > net/netfilter/ipvs/ip_vs_ctl.c::ip_vs_stats_show > ^^^^^^^^^^^^^' > suggested otherwise - no big deal though, those other options are fine too. Ah, I stand corrected. In that case the netfilter PMDA might be a good candidate also. I think we could follow the good olde "doer decides" principle :)
> I think we could follow the good olde "doer decides" principle :) Yep, agreed.
See also https://bugzilla.redhat.com/show_bug.cgi?id=1316880.