Widget updating

Read 9304 times
I've a query about the poll feature (in advanced Customization at http://www.centova.com/doc/cast/user_manual/02_reference_manual/04_widgets/01_stream_status_summary).

I understand from the control panel that it refreshes once every minute.

Two questions:

1 Does it do that without the code in the above url.

2 Am I right to assume that shortening the poll frequency will refresh it more frequently?
If so, how frequent can it be without becoming a problem?
And what can the poll limit be changed to without that becoming a problem?

This is relevant because I have various short (less than 15 seconds) talk-clips, for which it'll be better to have appropriate info displayed.
Quote
Does it do that without the code in the above url.
Yes, the widget will follow those default directives, even if you don't add that configuration block, which includes them, to your web page.

Quote
Am I right to assume that shortening the poll frequency will refresh it more frequently?
You are entirely correct. Please note that lowering the poll frequency will cause the widget to reach the poll limit faster, and it will stop updating. So if you intend to lower the frequency, make sure to increase the poll limit accordingly.

Quote
If so, how frequent can it be without becoming a problem?
We can't really recommend anything lower than 60. And 15 (which is about how long some of your shorter clips might be) is probably way too low. If you have even 15 visitors even passively browsing your site at a time, that's one hit per second.

That may not be a problem on a station with only a few listeners, but if you happen to run the occasional popular show and a few hundred visitors hit your web site at once, Centova Cast is going to be hammered with tens or hundreds of status update requests per second. All of those have to be passed to the PHP backend, which is going to cause load issues and/or max out your php-fpm connection limit causing connection failures.

The default limit of 60 seconds is as far as you'd typically want to go, particularly if you want technical support from us. :) If you increase it beyond that, expect problems unless you have a very fast server and are familiar with tweaking php-fpm (via cc-appserver.conf) for high load.
Thanks for the comprehensive answer, which helps me to better understand.
(And I'm sorry for my tardy response - I didn't get an update email, so perhaps didn't subscribe to this topic.)

There's some follow-on points I'm not clear about, and hope you can clarify:

1 On the default setting of 'poll_frequency: 60000' and 'poll_limit: 60', does that mean it'll poll every 60 seconds (60000 milliseconds) and do that 60 times before stopping polling? If so, I can maybe understand the 'poll every 60 seconds' bit - which triggers the 'update at one minute interval', but the 'poll 60 times' bit confuses me... it seems that it'll poll 60 times (presumably once every minute) and then stop - so does that mean it stops updating after an hour? This seems odd, and I've likely misunderstood.

2 On a test-install, in which there's only a few listeners, as a test I set 'poll_frequency: 5000' - which I assume is 'update every 5 seconds' - but it appears to not update that often.

3 Longer-term, this'll be an a dedi-server. Assuming a high-spec machine and decent bandwidth (through a 1 or 10gbps dedicated port) what poll frequency could be handled... I guess this depends on number of listeners, so for simplicity I'll revise that question to a notional 'what poll frequency if 1000 sim listeners'?

4 When listening on iTunes, now playing' seems to update instantly when a new track begins. What's different about updating a .pls? Presumably it gets its info from the server - and is there a way to get a browser widget or player to update in this way?
Quote
it seems that it'll poll 60 times (presumably once every minute) and then stop - so does that mean it stops updating after an hour?
That's true. Using the default settings, it's going to stop updating after one hour. I'm not fully aware of the reasoning behind this. That's a question for our developers. It might be just some sort of anti AFK mechanism.

Quote
On a test-install, in which there's only a few listeners, as a test I set 'poll_frequency: 5000' - which I assume is 'update every 5 seconds' - but it appears to not update that often.
It appears that some of Centova Cast's caching configurations are preventing the widget from updating more often. These can be tweaked as well, and all you have to do is lower the STREAMINFO_CACHE_DURATION and SERVSTATE_CACHE_DURATION directives in the /usr/local/centovacast/etc/caching.conf file (and restart Centova Cast aftewards)

Quote
Assuming a high-spec machine and decent bandwidth (through a 1 or 10gbps dedicated port) what poll frequency could be handled... I guess this depends on number of listeners, so for simplicity I'll revise that question to a notional 'what poll frequency if 1000 sim listeners'?
Sorry, but can't make any recommendation on this one. I guess that you'll just have to play with these settings and see how that works out.

Quote
When listening on iTunes, now playing' seems to update instantly when a new track begins. What's different about updating a .pls? Presumably it gets its info from the server - and is there a way to get a browser widget or player to update in this way?
We've recently implemented Comet, an extension to HTTP which allows pushing data to browsers. We've implemented this for a few minor Centova Cast features (displaying progress bars during media library updates and such) to evaluate its reliability in production. If all goes well, we intend to release another update, that allows title updates to be delivered via comet as well, which will yield near-instant song change notifications.
Thanks.
This helps me to better understand things.