Replies: 4 comments 8 replies
-
I agree. Makes no sense. |
Beta Was this translation helpful? Give feedback.
-
Not much going on here. Maybe @driesvints @nunomaduro or @taylorotwell can elaborate on this? is there a reason why we start horizon full throttled? |
Beta Was this translation helpful? Give feedback.
-
i think, you can set autoScalingStrategy = size, on horizon config file, in supervisor's config |
Beta Was this translation helpful? Give feedback.
-
@michabbb I saw your PR. A reason might be that when you deploy in full load, you don't want a hiccup exactly after the deploy process. Correct me if I am wrong, but that formula from there assures the already working processes are subtracted from the max amount and only the difference is started, resulting in total = max number (that is already auto for me). There are 3 cases here. Max 10 Max 10 Max 10 Based on this if you are fully loaded at deploy, then 0 are started (I am not familiar with how the rest will be started after the old container shuts down). This might be considered more important than this other case: You are with empty queue and you will start the difference until full, then scale down. Now if the difference is closer to max => smaller load. |
Beta Was this translation helpful? Give feedback.
-
hi all,
i am very surprised i am unable to find anything about that issue.
laravel horizon is scaling - at least for me - completely wrong.
that means every supervisor starts as many workers as "max-processes" from the horizon config.
as seen here:
https://github.com/laravel/horizon/blob/d4e24a9cfff8cacfa44c75ca0ac759984f152d1c/src/Console/SupervisorCommand.php#L97
but that makes no sense at all. let´s say I have 5 supervisors, each with max-processes of 50 and an empty queue.
so why should I start 250 workers to scale them immediately down to 5 (min-processes).
pardon, for me, a scaler should always start as low as possible and scale up ONLY if needed, not the other way around.
so the specific line of code I am referring to should be like this:
with that, horizon only starts 1 worker for each supervisor and only scales up to "max-processes" if really needed.
you can argue: what´s the problem? you should never run more workers than your host is able to run. so in the worst case, you are running a few seconds on max load of your host before everything gets scaled down.
but for me, this is more a thing of "good principals", and don´t waste any resources if you don´t need to.
and some people may over-provision their queues. means: the host is on limit when running all queues on max,
but this usually never should happen. but with the current (auto) "scale" concept of horizon: when horizon starts,
the host is always on max load even when the queue is empty, and that makes no sense at all.
i would be happy if we could change that. but I have no idea where I have to address that issue.
i think another option in the horizon config like
always_start_with_one => true
could solve that issue easily.what do you think ?
thanks,
micha
Beta Was this translation helpful? Give feedback.
All reactions