Thank you @Merzley , I need a low latency interface (to trigger audio websocket push). This is my config in config/horizon.php look at the sleep value :
'defaults' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => ['default'],
'balance' => 'auto',
'autoScalingStrategy' => 'time',
'maxProcesses' => 10,
'maxTime' => 0,
'maxJobs' => 0,
'memory' => 1024,
'tries' => 1,
'timeout' => 1800,
'nice' => 0,
'sleep'=>.1
],
]
This reduce latency from 3s to 100ms ! I didnt reported a lot more CPU usage on a small intel N100 processor (6W watt CPU), still very low (laravel app + redis + horizon + pulse + custom laravel react/ratchet program, only few percent between 1 and 4%.
These are my tests with different sleep value on horizon : Tried with sleep 0 = high cpu usage on redis server, a full core load 100% ( / 400%). With .001 about 34% of one core With .01 it's 10% With .1 it's 1.3 - 2% (with all service stop redis still at 1.3% CPU load).
3s sleep default is too high for me, but 100ms is perfect, without any perceptible CPU usage increase and nearly instant reactivity.
Hardware is : N100 16GB DDR4 single channel, nvme 500Go (Beelink S12 pro). OS : Ubuntu server 24.04 LTS.