[ovs-dev] [PATCH] ofproto-dpif: Keep track of exact-match flow info

Ben Pfaff blp at nicira.com
Mon Mar 25 22:16:41 UTC 2013


On Fri, Mar 22, 2013 at 03:24:15PM -0700, Andy Zhou wrote:
> This patch adds more flow related stats to the output of
> "ovs-appctl dpif/show".  Specifically, the follow information
> are added per ofproto:
> 
> - Max flow table size
> - Average flow table size
> - Average flow table add rate
> - Average flow table delete rate
> - Average flow entry life in milliseconds
> 
> Feature #15366
> 
> Signed-off-by: Andy Zhou <azhou at nicira.com>

The word 'subfacet' is misspelled in member 'total_sufacet_life_span'.

I found the new members of struct ofproto_dpif a little hard to
understand.  How about something like this:

/* Subfacet statistics.
 *
 * These keep track of the total number of subfacets added and deleted and flow
 * life span.  They are useful for computing the flow rates stats exposed via
 * "ovs-appctl dpif/show".  The goal is to learn about traffic patterns in ways
 * that we can use later to improve Open vSwitch performance in new siutations.
 */

    long long int created;       /* Time ofproto_dpif was created. */
    unsigned int max_n_subfacet; /* Maximum number of flows. */

    /* The average number of subfacets... */
    struct avg_subfacet_rates hourly; /* ...over the last hour. */
    struct avg_subfacet_rates daily;  /* ...over the last day. */
    long long int last_minute;        /* Last time 'hourly' was updated. */

    /* Number of subfacets added or deleted since 'last_minute'. */
    unsigned int subfacet_add_count;
    unsigned int subfacet_del_count;
    /* Number of subfacets added or deleted from 'created' to 'last_minute'. */
    unsigned long long int total_subfacet_add_count;
    unsigned long long int total_subfacet_del_count;

    /* Sum of the number of milliseconds that each subfacet existed, over the
     * subfacets that have been added and then later deleted. */
    unsigned long long int total_subfacet_life_span;

    /* Incremented by the number of currently existing subfacets, each time we
     * pull statistics from the kernel. */
    unsigned long long int total_subfacet_count;

I think there is an issue with 'total_subfacet_count'.  This is
incremented approximately once per second, but avg_subfacet_count() only
divides it by 60*minutes, where minutes is the whole of minutes elapsed.
I think that this means that avg_subfacet_count() will tend to increase
over the course of a minute and then drop back down as the next minute
ticks over.  Also, update_stats() updates total_subfacet_count but that
function may run more often than once a second (if there are many
subfacets) or less often than once a second (if OVS doesn't get
scheduled on time) so I think that we ought to count the number of
updates instead of assuming that there are exactly 60 per minute.

Thanks,

Ben.



More information about the dev mailing list