Horizon: Question: How does auto balancing work with multiple supervisors?

Created on 26 Sep 2017  路  3Comments  路  Source: laravel/horizon

I'm a bit confused by the configuration, maybe you can clarify. I get that you can change your configuration by environment, but what is the purpose of having multiple "supervisors" inside one environment? If I put queues A and B on supervisor 1 with 2 procs and set it to "auto" and queues C and D on supervisor 2 with 2 procs, will the autobalancer allocate processes from supervisor 2 to queues A and B? Or does the autobalancing only work within a single supervisor?

Also, if I want to set the balance to "false", is that the string false or the boolean false? The docs are not clear on that.

Final question. I created a supervisor with 12 queues set to "simple" with 1 process. However, the horizon dashboard shows that it created 12 processes, presumably one for each queue. (It did the same with "auto".) Can you clarify if this the intended behavior with regard to number of processes vs number of queues vs balancing setting?

Most helpful comment

@pmartelletti I did a bit of code delving the other day in an attempt to answer my questions. I don't have a very good grasp on how the internals work, so it would still be nice to get an official answer, but as far as I can tell, all the process balancing happens inside of the supervisor. I.e., a process will never be deallocated from one supervisor and added to another supervisor. Because of this, I have my config set up to put all of my queues within a single supervisor set to auto so that they all balance and the processes get allocated as efficiently as possible.

is that the string false or the boolean false

Still would like to know what this is supposed to be. I think I remember trying the string "false" and that seemed to work, but I don't want to be doing something that is not supported and that could break in future releases. In the code I also saw references to the balancing option "off", which seemed to be equivalent to "false"/false, but "off" is not referred to in the docs so that may be an internal-only thing.

I created a supervisor with 12 queues set to "simple" with 1 process. However, the horizon dashboard shows that it created 12 processes, presumably one for each queue.

This would still be nice to have an answer for as well. I guess it's fine, but I was kind of hoping to be able to allocate any number of processors I want (say, 6) to all of my dozen+ queues and have them autobalanced by whatever queues have the longest wait. Forcing it to allocate a minimum of 12 processes has the potential to overload my (I thought beefy) 12-core server if I get a sudden spike. I suppose I could move some queues to another supervisor with balancing turned off, but that defeats the purpose of autobalancing.

All 3 comments

@themsaid @taylorotwell need clarification on this one as well, as the docs are a bit confusing in this aspect.

Basically, what is not clear is if using balancing is just for queues in the same worker, or for all workers configured in horizon.

Thanks.

@pmartelletti I did a bit of code delving the other day in an attempt to answer my questions. I don't have a very good grasp on how the internals work, so it would still be nice to get an official answer, but as far as I can tell, all the process balancing happens inside of the supervisor. I.e., a process will never be deallocated from one supervisor and added to another supervisor. Because of this, I have my config set up to put all of my queues within a single supervisor set to auto so that they all balance and the processes get allocated as efficiently as possible.

is that the string false or the boolean false

Still would like to know what this is supposed to be. I think I remember trying the string "false" and that seemed to work, but I don't want to be doing something that is not supported and that could break in future releases. In the code I also saw references to the balancing option "off", which seemed to be equivalent to "false"/false, but "off" is not referred to in the docs so that may be an internal-only thing.

I created a supervisor with 12 queues set to "simple" with 1 process. However, the horizon dashboard shows that it created 12 processes, presumably one for each queue.

This would still be nice to have an answer for as well. I guess it's fine, but I was kind of hoping to be able to allocate any number of processors I want (say, 6) to all of my dozen+ queues and have them autobalanced by whatever queues have the longest wait. Forcing it to allocate a minimum of 12 processes has the potential to overload my (I thought beefy) 12-core server if I get a sudden spike. I suppose I could move some queues to another supervisor with balancing turned off, but that defeats the purpose of autobalancing.

Hi there,

Looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs or problems. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RicardoRamirezR picture RicardoRamirezR  路  3Comments

rossuhms picture rossuhms  路  5Comments

mikeminckler picture mikeminckler  路  3Comments

wturrell picture wturrell  路  5Comments

meathanjay picture meathanjay  路  3Comments