]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Change report_interval from 4 to 30, agent_down_time from 9 to 75
authorAssaf Muller <amuller@redhat.com>
Sun, 16 Mar 2014 11:01:18 +0000 (13:01 +0200)
committerAssaf Muller <amuller@redhat.com>
Tue, 18 Mar 2014 08:25:04 +0000 (10:25 +0200)
report_interval is how often an agent sends out a heartbeat to the
service. The Neutron service responds to these 'report_state' RPC
messages by updating the agent's heartbeat DB record.
The last heartbeat is then compared to the configured
agent_down_time to determine if the agent is up or down.
The agent's status is used when scheduling networks on DHCP
and L3 agents.

In the spirit of sane defaults suited for production, these values
should be bumped to reduce the load on the Neutron service
dramatically, freeing up CPU time to perform intensive operations.

DocImpact
Closes-Bug: #1293083
Change-Id: I77bcf8f66f74ba55513c989caead1f96c92b9832

etc/neutron.conf
neutron/agent/common/config.py
neutron/db/agents_db.py
neutron/tests/unit/nec/test_nec_agent.py

index 0a0cca3f09e8dcd8314911cf630dc3337d17a27b..ca59514f820ef599d0e3249e13c4b3907cf92dfb 100644 (file)
@@ -225,7 +225,7 @@ notification_driver = neutron.openstack.common.notifier.rpc_notifier
 # =========== items for agent management extension =============
 # Seconds to regard the agent as down; should be at least twice
 # report_interval, to be sure the agent is down for good
-# agent_down_time = 9
+# agent_down_time = 75
 # ===========  end of items for agent management extension =====
 
 # =========== items for agent scheduler extension =============
@@ -385,7 +385,7 @@ notification_driver = neutron.openstack.common.notifier.rpc_notifier
 # =========== items for agent management extension =============
 # seconds between nodes reporting state to server; should be less than
 # agent_down_time, best if it is half or less than agent_down_time
-# report_interval = 4
+# report_interval = 30
 
 # ===========  end of items for agent management extension =====
 
index 33e23945bf29a5b84a62bf43e978d26b04dba065..5f83517d5073192667b258b9c4db5189081fdadd 100644 (file)
@@ -32,7 +32,7 @@ ROOT_HELPER_OPTS = [
 ]
 
 AGENT_STATE_OPTS = [
-    cfg.FloatOpt('report_interval', default=4,
+    cfg.FloatOpt('report_interval', default=30,
                  help=_('Seconds between nodes reporting state to server; '
                         'should be less than agent_down_time, best if it '
                         'is half or less than agent_down_time.')),
index 938c30fa2c818e9aa7633f88fba844f9567379c0..08358e85f040af6ca32c5a1c100ad288f3a07109 100644 (file)
@@ -33,7 +33,7 @@ from neutron.openstack.common import timeutils
 
 LOG = logging.getLogger(__name__)
 cfg.CONF.register_opt(
-    cfg.IntOpt('agent_down_time', default=9,
+    cfg.IntOpt('agent_down_time', default=75,
                help=_("Seconds to regard the agent is down; should be at "
                       "least twice report_interval, to be sure the "
                       "agent is down for good.")))
index 2e45306159d633af1040255d1c52e2491c865ff8..1bace38cc770bf9eb3db61336ee24cdbf187f8eb 100644 (file)
@@ -196,7 +196,7 @@ class TestNecAgent(TestNecAgentBase):
     def test_report_state_installed(self):
         self.loopingcall.assert_called_once_with(self.agent._report_state)
         instance = self.loopingcall.return_value
-        instance.start.assert_called_once_with(interval=4)
+        self.assertTrue(instance.start.called)
 
     def _check_report_state(self, cur_ports, num_ports, fail_mode,
                             first=False):