Page 1 of 1

Converting Agent Comms to Websockets

PostPosted: Thu Aug 27, 2020 4:17 am
by mariusmarais
I've been looking at Vicidial Agent Screen performance on older hardware recently, combined with the background tab throttling that Chrome does. (We're in a regulated industry, so sticking to older browsers is difficult from a security compliance perspective.)

Is there any interest in converting the Agent Screen's comms with the webservers away from polling to using only websockets and push from the server?

As far as I can tell from https://caniuse.com/#search=websockets , websockets should be available in common browsers > 2012, so it should be supported in the wild.

It may well just move strain from the web browser to the web servers, as something would still need to check for updates server-side, unless an event-based system were implemented.

So before going down that road, is there any interest? Can you think of non-obvious reasons why this would be a bad idea? From the ViciPhone success stories it seems like websockets generally work well in practise.

(FWIW, this is about Vicidial Agent Screen <=> Vicidial Web Servers, not Agent Screen <=> custom app, which should be covered by http://vicidial.org/docs/WEBSOCKETS_SUPPORT.txt)

Re: Converting Agent Comms to Websockets

PostPosted: Thu Aug 27, 2020 6:09 am
by mariusmarais
Incidentally, aside from playing audio via ViciPhone, it looks like using websockets (at all?) may exempt a tab from some of the background throttling, besides the fact that it should use less resources in general than polling.

There are a number of automatic exemptions from this throttling:
...
Applications with real-time connections (WebSockets and WebRTC), to avoid closing these connections by timeout. The run-timers-once-a-second rule is still applied in these cases.

(from https://developers.google.com/web/updat ... throttling)

Re: Converting Agent Comms to Websockets

PostPosted: Thu Aug 27, 2020 7:57 am
by mflorell
That would be a rather large undertaking, but we would certainly be willing to take a look at it to see how viable it may be.

Yes, this would certainly require a lot more webserver resources, although the impact would be hard to measure until you were able to get some installations running it in production.

Re: Converting Agent Comms to Websockets

PostPosted: Fri Aug 28, 2020 2:28 am
by mariusmarais
OK, I'll start poking at it to get an idea what I'm for.

Will report back as soon as I have a rough plan.