]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Use separate queue for agent state reports.
authorEugene Nikanorov <enikanorov@mirantis.com>
Tue, 22 Sep 2015 14:51:56 +0000 (18:51 +0400)
committerEugene Nikanorov <enikanorov@mirantis.com>
Wed, 30 Sep 2015 09:16:32 +0000 (13:16 +0400)
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

neutron/agent/dhcp/agent.py
neutron/agent/l3/agent.py
neutron/agent/metadata/agent.py
neutron/common/topics.py
neutron/plugins/hyperv/agent/l2_agent.py
neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py
neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py
neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py
neutron/plugins/ml2/plugin.py
neutron/services/metering/agents/metering_agent.py

index af0ccf5c7d2fe0914ae688670d52f63eecad76bb..4e4da5036ae3ef63f982b688f4a57332461ef6ab 100644 (file)
@@ -544,7 +544,7 @@ class NetworkCache(object):
 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,
index 3c698fa09790d712644d363e8c2e67ec2344d74a..6f2b9077253e8ec250e06dbfa5094e898ce6347d 100644 (file)
@@ -611,7 +611,7 @@ class L3NATAgentWithStateReport(L3NATAgent):
     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,
index c458c6d04e63db4e2c72b525969d0cb34cca8b91..b2ef3a30e501d4768d04c3540960949ef9661876 100644 (file)
@@ -287,7 +287,7 @@ class UnixDomainMetadataProxy(object):
 
     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,
index d0cc55a57e3b3d5c24e046617a9716a0a7c01bac..b8993aa8ffda3f9587d747cafae1c212450bbb8b 100644 (file)
@@ -28,6 +28,7 @@ UPDATE = 'update'
 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'
index 956e1ec38fae9f5ec40246b84e6ce6c5b1b50f8e..5a23c1c551938b7cf839a4dbba54b4489a2b3984 100644 (file)
@@ -100,7 +100,7 @@ class HyperVNeutronAgent(hyperv_neutron_agent.HyperVNeutronAgentMixin):
         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()
index 5c09498402973d9b7f37d2e54325d7855a2e9d69..54c767ebd89533edc75603ef5a7226404fc5fbce 100644 (file)
@@ -910,7 +910,7 @@ class LinuxBridgeNeutronAgentRPC(service.Service):
         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,
index 9b1c3116f09443c612bfd25ebd227d299f4ae3cd..1918b4950541ee7d1bc0874a4c8a229a56b32669 100644 (file)
@@ -119,7 +119,7 @@ class SriovNicSwitchAgent(object):
         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,
index b18716e861375ecb9fcb7c515388af461fe16154..0d02ce4ce1d2ff3eb79798489d11bdaa9a2198a5 100644 (file)
@@ -366,7 +366,7 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
         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()
index a8a406b05d381ade979e5d6239421d008e25c6d9..d6f98f26cf6d4ae7ab7e2d6e86f7521cf8c9e38b 100644 (file)
@@ -188,6 +188,9 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
         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):
index 10ead2b3733784fcad82bc85673263f26b5dacb3..930515c1a7771137715487e3f1895f5afc615ed7 100644 (file)
@@ -248,7 +248,7 @@ class MeteringAgentWithStateReport(MeteringAgent):
     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,