Bug 1205231 - RFE: provide IPVS/LVS metrics
Summary: RFE: provide IPVS/LVS metrics
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: pcp
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: pcp-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-24 13:30 UTC by Marko Myllynen
Modified: 2022-04-05 00:25 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-04-05 00:25:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
ip_vs_stats (306 bytes, text/plain)
2015-03-24 13:30 UTC, Marko Myllynen
no flags Details

Description Marko Myllynen 2015-03-24 13:30:53 UTC
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.

Comment 1 Nathan Scott 2015-03-26 05:41:22 UTC
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.

Comment 2 Marko Myllynen 2015-03-27 08:18:22 UTC
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.

Comment 3 Nathan Scott 2015-03-30 02:31:52 UTC
(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.

Comment 4 Marko Myllynen 2015-04-01 11:58:12 UTC
(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 :)

Comment 9 Nathan Scott 2015-04-07 03:02:31 UTC
> I think we could follow the good olde "doer decides" principle :)

Yep, agreed.

Comment 10 Marko Myllynen 2016-03-11 11:49:21 UTC
See also https://bugzilla.redhat.com/show_bug.cgi?id=1316880.

Comment 11 Nathan Scott 2022-04-05 00:25:22 UTC
I'm going to close this out based on #c9 - let's get an upstream issue opened if these metrics are useful to folk.


Note You need to log in before you can comment on or make changes to this bug.