Add config options for raet network buffers count

Added two options for raet road stack and lane stack network buffers
count: 'raet_road_bufcnt' and 'raet_lane_bufcnt'
This commit is contained in:
Dmitry Kuzmenko 2015-05-22 19:07:55 +03:00
parent 01fb405d01
commit 698211baa5
2 changed files with 18 additions and 4 deletions

View File

@ -635,6 +635,8 @@ VALID_OPTS = {
'raet_main': bool,
'raet_clear_remotes': bool,
'raet_clear_remote_masters': bool,
'raet_road_bufcnt': int,
'raet_lane_bufcnt': int,
'cluster_mode': bool,
'cluster_masters': list,
'sqlite_queue_dir': str,
@ -820,6 +822,8 @@ DEFAULT_MINION_OPTS = {
'raet_main': False,
'raet_clear_remotes': True,
'raet_clear_remote_masters': True,
'raet_road_bufcnt': 2,
'raet_lane_bufcnt': 100,
'cluster_mode': False,
'cluster_masters': [],
'restart_on_error': False,
@ -1008,6 +1012,8 @@ DEFAULT_MASTER_OPTS = {
'raet_main': True,
'raet_clear_remotes': False,
'raet_clear_remote_masters': True,
'raet_road_bufcnt': 2,
'raet_lane_bufcnt': 100,
'cluster_mode': False,
'cluster_masters': [],
'sqlite_queue_dir': os.path.join(salt.syspaths.CACHE_DIR, 'master', 'queues'),

View File

@ -238,7 +238,8 @@ class SaltRaetRoadStackSetup(ioflo.base.deeding.Deed):
'uid': None,
'role': 'master',
'sighex': None,
'prihex': None}},
'prihex': None,
'bufcnt': 2}},
}
def _prepare(self):
@ -292,6 +293,8 @@ class SaltRaetRoadStackSetup(ioflo.base.deeding.Deed):
sighex = roledata['sighex'] or self.local.data.sighex
prihex = roledata['prihex'] or self.local.data.prihex
bufcnt = self.opts.value.get('raet_road_bufcnt', self.local.data.bufcnt)
self.stack.value = RoadStack(store=self.store,
keep=keep,
name=name,
@ -306,7 +309,8 @@ class SaltRaetRoadStackSetup(ioflo.base.deeding.Deed):
txMsgs=txMsgs,
rxMsgs=rxMsgs,
period=3.0,
offset=0.5)
offset=0.5,
bufcnt=bufcnt)
if self.opts.value.get('raet_clear_remotes'):
for remote in list(self.stack.value.remotes.values()):
@ -789,7 +793,8 @@ class SaltRaetManorLaneSetup(ioflo.base.deeding.Deed):
'inode': '.salt.lane.manor.',
'stack': 'stack',
'local': {'ipath': 'local',
'ival': {'lanename': 'master'}},
'ival': {'lanename': 'master',
'bufcnt': 100}},
}
def _prepare(self):
@ -824,11 +829,14 @@ class SaltRaetManorLaneSetup(ioflo.base.deeding.Deed):
log.error(emsg + '\n')
raise ValueError(emsg)
bufcnt = self.opts.value.get('raet_lane_bufcnt', self.local.data.bufcnt)
name = 'manor'
self.stack.value = LaneStack(
name=name,
lanename=lanename,
sockdirpath=self.opts.value['sock_dir'])
sockdirpath=self.opts.value['sock_dir'],
bufcnt=bufcnt)
self.stack.value.Pk = raeting.PackKind.pack.value
self.event_yards.value = set()
self.local_cmd.value = deque()