mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
M #-: make flow concurrency configurable (#4880)
This commit is contained in:
parent
93c894e7af
commit
7332ae884e
@ -42,7 +42,11 @@
|
||||
|
||||
# Default timeout in seconds to wait VMs to report different states
|
||||
# This timeout is used when option report ready is true and for normal actions
|
||||
:default_wait_timeout: 30
|
||||
:wait_timeout: 30
|
||||
|
||||
# Number of threads to make actions with flows
|
||||
# Tune this depending of the load you will have
|
||||
:concurrency: 10
|
||||
|
||||
# Default shutdown action. Values: 'terminate', 'terminate-hard'
|
||||
:shutdown_action: 'terminate'
|
||||
|
@ -56,7 +56,6 @@ class EventManager
|
||||
# --------------------------------------------------------------------------
|
||||
DEFAULT_CONF = {
|
||||
:subscriber_endpoint => 'tcp://localhost:2101',
|
||||
:concurrency => 10,
|
||||
:cloud_auth => nil,
|
||||
:am => nil
|
||||
}
|
||||
@ -64,11 +63,11 @@ class EventManager
|
||||
def initialize(options)
|
||||
@conf = DEFAULT_CONF.merge(options)
|
||||
|
||||
@lcm = options[:lcm]
|
||||
@am = ActionManager.new(@conf[:concurrency], true)
|
||||
@cloud_auth = @conf[:cloud_auth]
|
||||
@lcm = options[:lcm]
|
||||
@am = ActionManager.new(@cloud_auth.conf[:concurrency], true)
|
||||
|
||||
@context = ZMQ::Context.new(1)
|
||||
@cloud_auth = @conf[:cloud_auth]
|
||||
@wait_timeout = @cloud_auth.conf[:wait_timeout]
|
||||
|
||||
# Register Action Manager actions
|
||||
|
@ -53,7 +53,6 @@ class ServiceLCM
|
||||
|
||||
em_conf = {
|
||||
:cloud_auth => @cloud_auth,
|
||||
:concurrency => 10,
|
||||
:lcm => @am
|
||||
}
|
||||
|
||||
|
@ -80,6 +80,7 @@ conf[:action_number] ||= 1
|
||||
conf[:action_period] ||= 60
|
||||
conf[:vm_name_template] ||= DEFAULT_VM_NAME_TEMPLATE
|
||||
conf[:wait_timeout] ||= 30
|
||||
conf[:concurrency] ||= 10
|
||||
conf[:auth] = 'opennebula'
|
||||
|
||||
set :bind, conf[:host]
|
||||
@ -181,7 +182,7 @@ GENERAL_EC = 500 # general error
|
||||
##############################################################################
|
||||
|
||||
# TODO: make thread number configurable?
|
||||
lcm = ServiceLCM.new(@client, 10, cloud_auth)
|
||||
lcm = ServiceLCM.new(@client, conf[:concurrency], cloud_auth)
|
||||
|
||||
##############################################################################
|
||||
# Service
|
||||
|
Loading…
x
Reference in New Issue
Block a user