aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierrick Louin <pierrick.louin@orange.com>2019-08-02 15:16:33 +0200
committerfmenguy <francoisregis.menguy@orange.com>2019-12-02 14:11:00 +0100
commit24314713446b6411cedce4329ab5ebfd6da678a2 (patch)
tree8d2bdfb2a722ca6f538c5567e7197173e703efba
parent15ecdba939f0377c0cccaa76e5a070ef2357056b (diff)
NFVBENCH-155 Add options to disable extra stats, latency stats and latency streamsPY27_BASE3.7.0py27
Change-Id: I9af56bf1b618a072adbc92b43e65e10b274d4f17 Signed-off-by: fmenguy <francoisregis.menguy@orange.com>
-rw-r--r--docs/testing/user/userguide/faq.rst46
-rwxr-xr-xnfvbench/cfg.default.yaml15
-rw-r--r--nfvbench/nfvbench.py23
-rwxr-xr-xnfvbench/traffic_client.py5
-rw-r--r--nfvbench/traffic_gen/trex_gen.py22
-rw-r--r--test/test_chains.py3
-rw-r--r--test/test_nfvbench.py5
7 files changed, 111 insertions, 8 deletions
diff --git a/docs/testing/user/userguide/faq.rst b/docs/testing/user/userguide/faq.rst
index 9a1a7da..a8aad9a 100644
--- a/docs/testing/user/userguide/faq.rst
+++ b/docs/testing/user/userguide/faq.rst
@@ -47,3 +47,49 @@ The most common issues that prevent traffic from passing are:
- if the switch port is configured as access port, you must disable vlan_tagging in the NFVbench configuration
- of the switch port is configured as trunk (recommended method), you must enable it
+
+Issues with high performances at a high line rate
+-------------------------------------------------
+
+Flow statistics and/or latency stream can cause performance issue when testing high line rate.
+
+Flow statistics implies CPU usage to analyse packets and retrieve statistics. CPU can reach 100% usage when high throughput is tested because only one CPU is used for packet reception in TRex.
+The ``--no-flow-stats`` option allows you to disable TRex statistics aggregation during the NFVBench test.
+This, will permit to save CPU capabilities used for packet reception.
+
+Example of use :
+
+.. code-block:: bash
+
+ nfvbench ``--no-flow-stats``
+
+ 2019-10-28 10:26:52,099 INFO End-to-end connectivity established
+ 2019-10-28 10:26:52,127 INFO Cleared all existing streams
+ 2019-10-28 10:26:52,129 INFO Traffic flow statistics are disabled.
+
+
+Latency streams implies also CPU usage to analyse packets and retrieve latency values. CPU can reach 100% usage when high throughput is tested because only one CPU is used for packet reception in TRex.
+The ``--no-latency-streams`` option allows you to disable latency streams during the NFVBench test.
+This, will permit to save CPU capabilities used for packet reception but no latency information will be return (to be used only if latency value has no meaning for your test).
+
+Example of use :
+
+.. code-block:: bash
+
+ nfvbench ``--no-latency-streams``
+ 2019-10-28 10:30:03,955 INFO End-to-end connectivity established
+ 2019-10-28 10:30:03,982 INFO Cleared all existing streams
+ 2019-10-28 10:30:03,982 INFO Latency streams are disabled
+
+
+Latency flow statistics implies CPU usage to analyse packets and retrieve statistics. CPU can reach 100% usage when high throughput is tested because only one CPU is used for packet reception in TRex.
+The ``--no-latency-stats`` option allows you to disable TRex statistics aggregation for latency packets during the NFVBench test.
+This, will permit to save CPU capabilities used for packet reception.
+
+Example of use :
+
+.. code-block:: bash
+
+ nfvbench ``--no-latency-stats``
+ 2019-10-28 10:28:21,559 INFO Cleared all existing streams
+ 2019-10-28 10:28:21,567 INFO Latency flow statistics are disabled.
diff --git a/nfvbench/cfg.default.yaml b/nfvbench/cfg.default.yaml
index fdd5f84..551b1c4 100755
--- a/nfvbench/cfg.default.yaml
+++ b/nfvbench/cfg.default.yaml
@@ -755,3 +755,18 @@ no_vswitch_access: false
# Can be overriden by --service-mode
# Should be left to the default value (false)
service_mode: false
+
+# Disable extra flow stats (on high load traffic)
+# Can be overriden by --no-flow-stats
+# Should be left to the default value (false)
+no_flow_stats: false
+
+# Disable flow stats for latency traffic
+# Can be overriden by --no-latency-stats
+# Should be left to the default value (false)
+no_latency_stats: false
+
+# Disable latency measurements (no streams)
+# Can be overriden by --no-latency-stream
+# Should be left to the default value (false)
+no_latency_streams: false
diff --git a/nfvbench/nfvbench.py b/nfvbench/nfvbench.py
index 80b9a93..18a7d2b 100644
--- a/nfvbench/nfvbench.py
+++ b/nfvbench/nfvbench.py
@@ -444,6 +444,21 @@ def _parse_opts_from_cli():
default=False,
help='Enable T-Rex service mode for debugging only')
+ parser.add_argument('--no-flow-stats', dest='no_flow_stats',
+ action='store_true',
+ default=False,
+ help='Disable extra flow stats (on high load traffic)')
+
+ parser.add_argument('--no-latency-stats', dest='no_latency_stats',
+ action='store_true',
+ default=False,
+ help='Disable flow stats for latency traffic')
+
+ parser.add_argument('--no-latency-streams', dest='no_latency_streams',
+ action='store_true',
+ default=False,
+ help='Disable latency measurements (no streams)')
+
opts, unknown_opts = parser.parse_known_args()
return opts, unknown_opts
@@ -583,6 +598,14 @@ def main():
config.vxlan = True
if opts.restart:
config.restart = True
+ if opts.service_mode:
+ config.service_mode = True
+ if opts.no_flow_stats:
+ config.no_flow_stats = True
+ if opts.no_latency_stats:
+ config.no_latency_stats = True
+ if opts.no_latency_streams:
+ config.no_latency_streams = True
# port to port loopback (direct or through switch)
if opts.l2_loopback:
config.l2_loopback = True
diff --git a/nfvbench/traffic_client.py b/nfvbench/traffic_client.py
index 7591062..6d870f6 100755
--- a/nfvbench/traffic_client.py
+++ b/nfvbench/traffic_client.py
@@ -679,7 +679,10 @@ class TrafficClient(object):
self.run_config['rates'][idx] = {'rate_pps': self.__convert_rates(rate)['rate_pps']}
self.gen.clear_streamblock()
- self.gen.create_traffic(frame_size, self.run_config['rates'], bidirectional, latency=True)
+ if self.config.no_latency_streams:
+ LOG.info("Latency streams are disabled")
+ self.gen.create_traffic(frame_size, self.run_config['rates'], bidirectional,
+ latency=not self.config.no_latency_streams)
def _modify_load(self, load):
self.current_total_rate = {'rate_percent': str(load)}
diff --git a/nfvbench/traffic_gen/trex_gen.py b/nfvbench/traffic_gen/trex_gen.py
index b8e32e3..53786f7 100644
--- a/nfvbench/traffic_gen/trex_gen.py
+++ b/nfvbench/traffic_gen/trex_gen.py
@@ -438,6 +438,8 @@ class TRex(AbstractTrafficGenerator):
"""
streams = []
pg_id, lat_pg_id = self.get_pg_id(port, chain_id)
+ if self.config.no_flow_stats:
+ LOG.info("Traffic flow statistics are disabled.")
if l2frame == 'IMIX':
for ratio, l2_frame_size in zip(IMIX_RATIOS, IMIX_L2_SIZES):
pkt = self._create_pkt(stream_cfg, l2_frame_size)
@@ -448,11 +450,13 @@ class TRex(AbstractTrafficGenerator):
if stream_cfg['vxlan'] is True:
streams.append(STLStream(packet=pkt,
flow_stats=STLFlowStats(pg_id=pg_id,
- vxlan=True),
+ vxlan=True)
+ if not self.config.no_flow_stats else None,
mode=STLTXCont(pps=ratio)))
else:
streams.append(STLStream(packet=pkt,
- flow_stats=STLFlowStats(pg_id=pg_id),
+ flow_stats=STLFlowStats(pg_id=pg_id)
+ if not self.config.no_flow_stats else None,
mode=STLTXCont(pps=ratio)))
if latency:
@@ -469,11 +473,13 @@ class TRex(AbstractTrafficGenerator):
if stream_cfg['vxlan'] is True:
streams.append(STLStream(packet=pkt,
flow_stats=STLFlowStats(pg_id=pg_id,
- vxlan=True),
+ vxlan=True)
+ if not self.config.no_flow_stats else None,
mode=STLTXCont()))
else:
streams.append(STLStream(packet=pkt,
- flow_stats=STLFlowStats(pg_id=pg_id),
+ flow_stats=STLFlowStats(pg_id=pg_id)
+ if not self.config.no_flow_stats else None,
mode=STLTXCont()))
# for the latency stream, the minimum payload is 16 bytes even in case of vlan tagging
# without vlan, the min l2 frame size is 64
@@ -483,14 +489,18 @@ class TRex(AbstractTrafficGenerator):
pkt = self._create_pkt(stream_cfg, 68)
if latency:
+ if self.config.no_latency_stats:
+ LOG.info("Latency flow statistics are disabled.")
if stream_cfg['vxlan'] is True:
streams.append(STLStream(packet=pkt,
flow_stats=STLFlowLatencyStats(pg_id=lat_pg_id,
- vxlan=True),
+ vxlan=True)
+ if not self.config.no_latency_stats else None,
mode=STLTXCont(pps=self.LATENCY_PPS)))
else:
streams.append(STLStream(packet=pkt,
- flow_stats=STLFlowLatencyStats(pg_id=lat_pg_id),
+ flow_stats=STLFlowLatencyStats(pg_id=lat_pg_id)
+ if not self.config.no_latency_stats else None,
mode=STLTXCont(pps=self.LATENCY_PPS)))
return streams
diff --git a/test/test_chains.py b/test/test_chains.py
index 5fd1ce6..741bee7 100644
--- a/test/test_chains.py
+++ b/test/test_chains.py
@@ -70,6 +70,9 @@ def _get_chain_config(sc=ChainType.PVP, scc=1, shared_net=True, rate='1Mpps'):
config.duration_sec = 2
config.interval_sec = 1
config.openrc_file = "dummy.rc"
+ config.no_flow_stats = False
+ config.no_latency_stats = False
+ config.no_latency_streams = False
return config
def test_chain_runner_ext_no_openstack():
diff --git a/test/test_nfvbench.py b/test/test_nfvbench.py
index 04e3191..7a0a9ed 100644
--- a/test/test_nfvbench.py
+++ b/test/test_nfvbench.py
@@ -332,7 +332,10 @@ def _get_dummy_tg_config(chain_type, rate, scc=1, fc=10, step_ip='0.0.0.1',
'mbuf_factor': None,
'disable_hdrh': None,
'mbuf_64': None,
- 'service_mode': False
+ 'service_mode': False,
+ 'no_flow_stats': False,
+ 'no_latency_stats': False,
+ 'no_latency_streams': False
})