{"action":"closed","issue":{"url":"https://api.github.com/repos/laravel/horizon/issues/134","repository_url":"https://api.github.com/repos/laravel/horizon","labels_url":"https://api.github.com/repos/laravel/horizon/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/laravel/horizon/issues/134/comments","events_url":"https://api.github.com/repos/laravel/horizon/issues/134/events","html_url":"https://github.com/laravel/horizon/issues/134","id":256684678,"node_id":"MDU6SXNzdWUyNTY2ODQ2Nzg=","number":134,"title":"Ability to add custom load balancing for realtime queues","user":{"login":"halaei","id":7089140,"node_id":"MDQ6VXNlcjcwODkxNDA=","avatar_url":"https://avatars1.githubusercontent.com/u/7089140?v=4","gravatar_id":"","url":"https://api.github.com/users/halaei","html_url":"https://github.com/halaei","followers_url":"https://api.github.com/users/halaei/followers","following_url":"https://api.github.com/users/halaei/following{/other_user}","gists_url":"https://api.github.com/users/halaei/gists{/gist_id}","starred_url":"https://api.github.com/users/halaei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halaei/subscriptions","organizations_url":"https://api.github.com/users/halaei/orgs","repos_url":"https://api.github.com/users/halaei/repos","events_url":"https://api.github.com/users/halaei/events{/privacy}","received_events_url":"https://api.github.com/users/halaei/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-11T12:28:35Z","updated_at":"2018-10-26T13:48:49Z","closed_at":"2018-10-26T13:48:49Z","author_association":"CONTRIBUTOR","body":"We have a use-case in which\r\n\r\n1. Jobs should be immediately popped out of the queues after being pushed. The pop() method of the queue driver should support waiting when the queue is empty and should return the job immediately after the job is pushed. For that I have my own Redis queue driver.\r\n2. There is no need to retry failed jobs.\r\n3. A queue should be flushed when there are more than a configurable number of jobs waiting in it. The number may be as small as 1.\r\n4. In order to minimize response time and minimize the need to flush the queues, the number of workers on each queue should ideally be more than the number of jobs at any given time.\r\n5. There is really no need to monitor what goes into the queues.\r\n\r\nIn this use-case I think the load balancer should:\r\n1. Flush the overflowing queues when it has to.\r\n2. Detect the need for scaling up/down based on the amount of time it takes for a workers to pop a job from a queue. The faster the worker pop() the busier the queue is. The load balancer may also consider other metrics such as the average processing time for each job.\r\n\r\nCan you help to find out the best way to add this custom load-balancing requirements?"}}
{"actor":{"display_login":"driesvints"}}