Bug #1673

Support for 64-bit net_rx and net_tx counters

Added by Simon Boulet over 6 years ago. Updated about 6 years ago.

Status:ClosedStart date:11/30/2012
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:Release 4.0
Resolution:fixed Pull request:
Affected Versions:OpenNebula 3.8

Description

Current version of OpenNebula does not support network usage counters above 2GB (32-bit). The net_rx and net_tx counters are 32-bit signed integer. When a VMM POLL request reports usage above 2,147,483,647 bytes, OpenNebula is unable to parse the counter and will not update the counter in the VM monitoring entry.

This patch adds support for 64-bit signed long long net_rx and net_tx counters.

64-bit-net-tx-net-rx.patch Magnifier (5.12 KB) Simon Boulet, 11/30/2012 03:45 AM

Associated revisions

Revision 5d540951
Added by Ruben S. Montero over 6 years ago

Bug #1673: Add support for 64-bit net_tx/net_rx counters. Contributed by Simon Boulet.

Revision 7bbefea0
Added by Ruben S. Montero about 6 years ago

Bug #1673: Add support for 64-bit net_tx/net_rx counters. Contributed by Simon Boulet.

Revision 6b93d089
Added by Ruben S. Montero about 6 years ago

Bug #1673: Add support for 64-bit net_tx/net_rx counters. Contributed by Simon Boulet.
(cherry picked from commit 5d54095119d0ec652edbf71e0ba3967c62734f4b)

History

#1 Updated by Carlos Martín over 6 years ago

Hi,

Thanks for the patch.
Since we are going to change to the 4.x series, I wonder if we should go a step further and change it to unsinged 64b, and measured in MB, not Bytes

#2 Updated by Simon Boulet over 6 years ago

Hi Carlos,

Thanks for your feedback.

I don't think making the measurements in MB instead of bytes is a good idea. It's quite common to measure network usage in bytes. SNMP for example reports network usage in bytes, and most graphing tools such as MRTG use bytes. Also I don't think it's necessary, the maximum value for a signed 64-bit is 9,223,372,036,854,775,807, or about 8,589,934,592 GB (assuming we use bytes counters). If my calculations are right, a VM that would be directly attached to a full Gigabit link (125MB per second) would take about 2179 years to reach the limit.

At first I wanted to propose an unsigned 64-bit patch, but the OpenNebula core seems to be initializing counters to -1, and also seems to be using -1 to detect polling errors.

I'd love to see my patch go through the next revision. It's simple enough and doesn't seems to be breaking anything for me.

Simon

#3 Updated by Ruben S. Montero over 6 years ago

  • Status changed from New to Closed
  • Target version set to Release 4.0
  • Resolution set to fixed

Applied as is in master.

Thank you very much for your contribution!

Also available in: Atom PDF