90
90
' (Disable by setting to 0)' ),
91
91
cfg .IntOpt ('num_proc' ,
92
92
default = 100 ,
93
- help = 'maximum allowed subprocess to launch to mimic the nova-compute updates.'
93
+ help = 'number of subprocess to launch to mimic the nova-compute updates.'
94
94
'each subprocess will update num/num_proc number of compute nodes'
95
95
'at a periodic interval of 60/num_proc' ),
96
96
cfg .IntOpt ('start' ,
@@ -211,6 +211,7 @@ def _statmap(stats):
211
211
num = total
212
212
if start <= 0 :
213
213
start = 0
214
+ maximum_data = num / CONF .num_proc or 1
214
215
215
216
print "# of compute nodes total: %d" % total
216
217
print "# of compute nodes to update: %d" % num
@@ -234,13 +235,17 @@ def _statmap(stats):
234
235
datas .append ((compute_ref , values ))
235
236
236
237
#prepare for the update process
237
- if len (datas ) >= num / CONF .num_proc and len (procs ) < CONF .num_proc - 1 :
238
- p = Process (target = mimic_update , args = (copy .deepcopy (datas ), _get_initial_delay ()))
238
+ if len (datas ) == maximum_data and len (procs ) < CONF .num_proc - 1 :
239
+ initial_delay = _get_initial_delay ()
240
+ p = Process (target = mimic_update , args = (copy .deepcopy (datas ), initial_delay ))
239
241
procs .append (p )
242
+ LOG .debug ("Prepare new subprocess for %d nodes, initial_dealy %d" , len (datas ), initial_delay )
240
243
datas = []
241
244
#remaining data
242
245
if len (datas ):
243
- p = Process (target = mimic_update , args = (copy .deepcopy (datas ), _get_initial_delay ()))
246
+ initial_delay = _get_initial_delay ()
247
+ p = Process (target = mimic_update , args = (copy .deepcopy (datas ), initial_delay ))
248
+ LOG .debug ("Prepare new subprocess for %d nodes, initial_dealy %d" , len (datas ), initial_delay )
244
249
procs .append (p )
245
250
datas = []
246
251
0 commit comments