-
Notifications
You must be signed in to change notification settings - Fork 637
Laravel websockets periodically failed to broadcast event #717
Comments
using a queue? without a better diff of dev vs production config the infos are not enough to help |
hi @simonbuehler , we have exactly same issue as above. laravel-websockets running behind nginx proxy with ssl. dev & prod server use same config as following:
after using laravel queue, the event broadcast is better but sometime it still hit the issue (event not firing). any suggests to handle this situation?we hit the issue even with only 1 active user that connect to the server. we are on cloud vm with 3 vCPU and 4G RAM with ssd |
maybe first try with another BROADCAST_DRIVER (log) and see if events always get fired then, do the events broadcast or broadcastnow ? |
Before implementing the nchan.io mod I found that adding a buffer on nginx helped if the queue is sync. If your using async queues then that is very odd. Using the BROADCAST_DRIVER log is a great suggestion to make sure they are firing. I highly recommend the nchan mod tho... amazing flexability on the frontend for pub/sub and sockets. Comes pretty much default with all nginx installs. |
actually, i have some broadcast events. some of them run at scheduled jobs and others on controller. using BROADCAST_DRIVER log, i see not all of these events are get fired. another exception on log is below:
i think exception above is in relation with following exception, so the event failed to get fired.
on queue:listen the event is coming, but after Processing line it shown as Failed instead of Processed. |
hi @shoemoney , currently i use redis as queue driver. using BROADCAST_DRIVER log result as above on log. thanks for recommending nchan, will take a look for it. |
I am not sure you can run it with timeouts like you are.... the pcntl extention doesnt take a string like the job scheduler. Hopefully the BeyondCode people will chime in. I have only ran it as a daemon with the artisan command so not sure on that. |
Ya if you use nginx I think you will be very impressed. It is so dynamic and flexible and works great with socket.io. literally you can match about anything..... Like for instance.... location ~ /pricestreams/(\w+)$ {
} location = /pub/lastUpdates {
} location ~ /pub/lastUpdates/(\w+)$ { location ~ /sub/account/(.*)$ { location ~ /pub/account/(.*)$ {
} location = /upstream/unsub { location = /upstream/sub { |
Hi @shoemoney , we have plan to try 3rd party service for easier scaling and reduce the complexity to manage websockets server. |
Yes because you can use redis with it, it can scale to the moon. *** Side note : I just started using this this morning and am very impressed: https://github.com/walkor/phpsocket.io |
I'd assume you have horizontal scaling in place and multiple instances of the websocket? It's also our problem and we addressed it using #778. There's quite a lot of issues that we have encountered and tried to address. |
We are a small team and we have trouble fixing the following bug:
We are implementing event broadcast in Laravel project using Beyondcode Laravel-Websockets and VueJs client that listens to echo private channel. When the event broadcasted, it works fine, but the next event broadcast is not delivered to the client. It needs at least 1 minutes with no activity for each event broadcasted, then it works again.
A bit strange is that this happens only in production server - the development server is fine.
backend:
laravel 8.0
jetstream 1.3
pusher-php-server 4.1
inertiajs 0.2.4
beyondcode/laravel-websockets 1.11.1
frontend:
axios 0.19
pusher-js 7.0
vue 2.6.11
tailwindcss 2.0.3
laravel-echo 1.8.1
The text was updated successfully, but these errors were encountered: