Skip to content

Commit

Permalink
Combine batches of successive roles for same nodes,
Browse files Browse the repository at this point in the history
we can speed-up the application of (n+1)th role if the n if both the
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
  • Loading branch information
Sumit Jamgade committed Oct 2, 2017
1 parent 264b1f1 commit 058b6e4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion crowbar_framework/app/models/service_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,8 @@ def apply_role(role, inst, in_queue, bootstrap = false)

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

batches << [roles, nodes_in_batch] unless nodes_in_batch.empty?
if pnodes_in_batch == nodes_in_batch && !proles.nil?
# proles is same as batches[-1][0]
proles << roles
else
proles = roles
pnodes_in_batch = nodes_in_batch
batches << [roles, nodes_in_batch] unless nodes_in_batch.empty?
end
end
Rails.logger.debug "batches: #{batches.inspect}"

Expand Down

0 comments on commit 058b6e4

Please sign in to comment.