#! /usr/bin/env python3 import nba, os import sys for netdev in nba.get_netdevices(): print(netdev) for coproc in nba.get_coprocessors(): print(coproc) node_cpus = nba.get_cpu_node_mapping() for node_id, cpus in enumerate(node_cpus): print('Cores in NUMA node {0}: [{1}]'.format(node_id, ', '.join(map(str, cpus)))) # The values read by the framework are: # - system_params # - io_threads # - comp_threads # - coproc_threads # - queues # - thread_connections # 64, 64, 192 is optimal parameter for ipv4-router system_params = { 'IO_BATCH_SIZE': int(os.environ.get('NBA_IO_BATCH_SIZE', 32)), 'COMP_BATCH_SIZE': int(os.environ.get('NBA_COMP_BATCH_SIZE', 32)), 'COPROC_PPDEPTH': int(os.environ.get('NBA_COPROC_PPDEPTH', 32)), 'COPROC_CTX_PER_COMPTHREAD': 1, } print("# logical cores: {0}, # physical cores {1} (hyperthreading {2})".format( nba.num_logical_cores, nba.num_physical_cores, "enabled" if nba.ht_enabled else "disabled"
#! /usr/bin/env python3 import nba, os import sys for netdev in nba.get_netdevices(): print(netdev) for coproc in nba.get_coprocessors(): print(coproc) node_cpus = nba.get_cpu_node_mapping() for node_id, cpus in enumerate(node_cpus): print('Cores in NUMA node {0}: [{1}]'.format(node_id, ', '.join(map(str, cpus)))) # The values read by the framework are: # - system_params # - io_threads # - comp_threads # - coproc_threads # - queues # - thread_connections # 64, 64, 192 is optimal parameter for ipv4-router system_params = { 'IO_BATCH_SIZE': int(os.environ.get('NBA_IO_BATCH_SIZE', 64)), 'COMP_BATCH_SIZE': int(os.environ.get('NBA_COMP_BATCH_SIZE', 64)), 'COPROC_PPDEPTH': int(os.environ.get('NBA_COPROC_PPDEPTH', 32)), 'COPROC_CTX_PER_COMPTHREAD': 1, } print("# logical cores: {0}, # physical cores {1} (hyperthreading {2})".format( nba.num_logical_cores, nba.num_physical_cores, "enabled" if nba.ht_enabled else "disabled"