Skip to content

Commit ae3a82f

Browse files
author
Sumit Jamgade
committed
Combine batches of successive roles for same nodes,
we can speed-up the application of (n+1)th role if both(n,n+1) roles are being applied on the same node. This speedup of deployment of ceilometer by atleast 1m20s (measured: 90sec) and swift by ~20s. eg. In our 2node deployment ceilometer{server,central} are always applied on the same node, given that they have different priorities, they are to be applied, one after the other. This does not violate any order constraints as the application procedure of (n+1)th role is transparent to the nth role
1 parent 264b1f1 commit ae3a82f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

crowbar_framework/app/models/service_object.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,8 @@ def apply_role(role, inst, in_queue, bootstrap = false)
10711071

10721072
# element_order is an Array where each item represents a batch of roles and
10731073
# the batches must be applied sequentially in this order.
1074+
pnodes_in_batch = nil
1075+
proles = nil
10741076
element_order.each do |roles|
10751077
# roles is an Array of names of Chef roles which can all be
10761078
# applied in parallel.
@@ -1169,7 +1171,14 @@ def apply_role(role, inst, in_queue, bootstrap = false)
11691171
end
11701172
end # roles.each
11711173

1172-
batches << [roles, nodes_in_batch] unless nodes_in_batch.empty?
1174+
if pnodes_in_batch == nodes_in_batch && !proles.nil?
1175+
# proles is same as batches[-1][0]
1176+
proles << roles
1177+
else
1178+
proles = roles
1179+
pnodes_in_batch = nodes_in_batch
1180+
batches << [roles, nodes_in_batch] unless nodes_in_batch.empty?
1181+
end
11731182
end
11741183
Rails.logger.debug "batches: #{batches.inspect}"
11751184

0 commit comments

Comments
 (0)