This optimization is needed for big clusters with hundreds
of agents where the spike of activity may trigger a burst
of RPC requests that would prevent neutron-server from processing
agent heart beats in time, triggering resource rescheduling.
This will be further optimized by running dedicated RPC workers
for state reports processing.
Related-Bug: #
1496410
Change-Id: Id86a1f962aaa4f64011d57ae55d240f890cca4f7
class DhcpAgentWithStateReport(DhcpAgent):
def __init__(self, host=None, conf=None):
super(DhcpAgentWithStateReport, self).__init__(host=host, conf=conf)
- self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN)
+ self.state_rpc = agent_rpc.PluginReportStateAPI(topics.REPORTS)
self.agent_state = {
'binary': 'neutron-dhcp-agent',
'host': host,
def __init__(self, host, conf=None):
self.use_call = True
super(L3NATAgentWithStateReport, self).__init__(host=host, conf=conf)
- self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN)
+ self.state_rpc = agent_rpc.PluginReportStateAPI(topics.REPORTS)
self.agent_state = {
'binary': 'neutron-l3-agent',
'host': host,
def _init_state_reporting(self):
self.context = context.get_admin_context_without_session()
- self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN)
+ self.state_rpc = agent_rpc.PluginReportStateAPI(topics.REPORTS)
self.agent_state = {
'binary': 'neutron-metadata-agent',
'host': cfg.CONF.host,
AGENT = 'q-agent-notifier'
PLUGIN = 'q-plugin'
L3PLUGIN = 'q-l3-plugin'
+REPORTS = 'q-reports-plugin'
DHCP = 'q-dhcp-notifer'
FIREWALL_PLUGIN = 'q-firewall-plugin'
METERING_PLUGIN = 'q-metering-plugin'
self.plugin_rpc = agent_rpc.PluginApi(topics.PLUGIN)
self.sg_plugin_rpc = sg_rpc.SecurityGroupServerRpcApi(topics.PLUGIN)
- self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN)
+ self.state_rpc = agent_rpc.PluginReportStateAPI(topics.REPORTS)
# RPC network init
self.context = context.get_admin_context_without_session()
LOG.info(_LI("RPC agent_id: %s"), self.agent_id)
self.topic = topics.AGENT
- self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN)
+ self.state_rpc = agent_rpc.PluginReportStateAPI(topics.REPORTS)
# RPC network init
# Handle updates from service
self.endpoints = [LinuxBridgeRpcCallbacks(self.context, self,
LOG.info(_LI("RPC agent_id: %s"), self.agent_id)
self.topic = topics.AGENT
- self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN)
+ self.state_rpc = agent_rpc.PluginReportStateAPI(topics.REPORTS)
# RPC network init
# Handle updates from service
self.endpoints = [SriovNicSwitchRpcCallbacks(self.context, self,
self.plugin_rpc = OVSPluginApi(topics.PLUGIN)
self.sg_plugin_rpc = sg_rpc.SecurityGroupServerRpcApi(topics.PLUGIN)
self.dvr_plugin_rpc = dvr_rpc.DVRServerRpcApi(topics.PLUGIN)
- self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN)
+ self.state_rpc = agent_rpc.PluginReportStateAPI(topics.REPORTS)
# RPC network init
self.context = context.get_admin_context_without_session()
self.topic = topics.PLUGIN
self.conn = n_rpc.create_connection(new=True)
self.conn.create_consumer(self.topic, self.endpoints, fanout=False)
+ self.conn.create_consumer(topics.REPORTS,
+ [agents_db.AgentExtRpcCallback()],
+ fanout=False)
return self.conn.consume_in_threads()
def _filter_nets_provider(self, context, networks, filters):
def __init__(self, host, conf=None):
super(MeteringAgentWithStateReport, self).__init__(host=host,
conf=conf)
- self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN)
+ self.state_rpc = agent_rpc.PluginReportStateAPI(topics.REPORTS)
self.agent_state = {
'binary': 'neutron-metering-agent',
'host': host,