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 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
  • Loading branch information
Sumit Jamgade committed Oct 6, 2017
1 parent 264b1f1 commit 1171ecf
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 @@ -1069,6 +1069,8 @@ def apply_role(role, inst, in_queue, bootstrap = false)
proposal = Proposal.where(barclamp: @bc_name, name: inst).first
save_proposal = false

nodes_previousbatch = nil
roles_previousbatch = nil
# element_order is an Array where each item represents a batch of roles and
# the batches must be applied sequentially in this order.
element_order.each do |roles|
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 nodes_previousbatch == nodes_in_batch && !roles_previousbatch.nil?
# roles_previousbatch is same as batches[-1][0]
roles_previousbatch << roles
else
roles_previousbatch = roles
nodes_previousbatch = 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 1171ecf

Please sign in to comment.