Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

On-Demand Relay Stuff
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
iunderwood



Joined: 23 Aug 2008
Posts: 114
Location: Leicester, MA

PostPosted: Sun Aug 15, 2010 9:34 pm    Post subject: On-Demand Relay Stuff Reply with quote

I've found a couple of caveats with the on-demand relay system when using a master/slave configuration.

* The slave mirrors all mountpoints, which is fine, except it's also shows the hidden mountpoints I have. Can hidden mounts be excluded from the streamlist?

* I have an update interval of 60 set in the slave config, but it only holds onto the last metadata received in a stream.

* Since I'm using a single master, single slave, I'm allowing listener connections to either the master or the slave. However, it's not necessarily easy to get an accurate listener count with an on-demad relay. Would it be possible to add a separate counter for relays and keep it separate from the listener count?

[Edit: Made some changes since I'm understanding the behavior better.]
_________________
++I;
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Mon Aug 16, 2010 12:52 pm    Post subject: Reply with quote

If the hidden relay is being listed on the streamlist then it's a bug and we would need more details on the situation, version, log etc.

With an inactive relay, the metadata is not updated because it is in-stream, which is not being transferred.

I'm not sure what the issue is on the 3rd query. The listener count should be accurate for that individual mount.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
iunderwood



Joined: 23 Aug 2008
Posts: 114
Location: Leicester, MA

PostPosted: Mon Aug 16, 2010 9:13 pm    Post subject: Reply with quote

The version in question is KH25.

Part 1: Hidden Relay in /admin/streams:

The URL call to /admin/streams is listing 6 streams, two of which I have hidden in the configuration.

Code:

<mount>
  <mount-name>/incoming.ogg</mount-name>
  <hidden>1</hidden>
  <fallback-mount>/silence.ogg</fallback-mount>
  <fallback-override>1</fallback-override>
</mount>

<mount>
  <mount-name>/silence.ogg</mount-name>
  <hidden>1</hidden>
</mount>


I get the list fully:

Code:

/admin/streams?mount=/incoming.ogg
/admin/streams?mount=/pf-32k.aacp
/admin/streams?mount=/pf-32k.ogg
/admin/streams?mount=/pf-64k.aacp
/admin/streams?mount=/pf-64k.ogg
/admin/streams?mount=/silence.ogg


Additionally, I'm seeing that /admin/streams isn't requiring authentication to get the list as evident in the access log, if I try from a browser:

96.32.x.x - - [17/Aug/2010:04:57:58 +0000] "GET /admin/streams HTTP/1.1" 200 253 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.Cool Gecko/20100722 Firefox/3.6.8" 0

Part 2: I understand ... makes sense.

Part 3: The listener count is technically accurate, based on clients. However, since I am allowing listeners to connect to the master as well as an on-demand relay (ODR), the count is off.

For example, one listener on a given mountpoint on the master shows as one and that's fine. However, one listener on an ODR counts as one on the relay, and now one on the master as well. Resulting in what appears to be two listeners when added up, but there is really only one.

Since I run the master server in question, I've been considering making it a hidden master only, and running a second IceCast instance on the same system as an ODR, just to simplify it a little bit.
_________________
++I;
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Mon Aug 16, 2010 10:21 pm    Post subject: Reply with quote

yep the hidden setting was ignored, the wrong flag is being checked. A simple change there means it works as it should, kh26 should fix that.

Looks like /admin/streams was getting auth bypassed if there was no mount/auth defined (useful if you want url/htpasswd auth for slaves), fixed should be in kh26

As for the listener counts, the master does not collect the different listener counts yet. There is partial work to retrieve details like that but it isn't complete yet. I'm hoping to get the master to connect to the slave to retrieve the stats in an non-polling way, so it will be near-accurate.

I should be releasing kh26 shortly, there was a non-ogg metadata bug possible.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
iunderwood



Joined: 23 Aug 2008
Posts: 114
Location: Leicester, MA

PostPosted: Mon Aug 16, 2010 11:31 pm    Post subject: Reply with quote

Much thanks for the fixes. I'm looking forward to making the latest compile.

On the listener vs. slave issue, I know there was a discussion a few years ago on using a master redirect. (http://icecast.imux.net/viewtopic.php?t=1440) That was back in the days of 2.3.1, but the thread is hanging and didn't indicate if the redirect worked or not. I didn't know the feature existed until yesterday, which got me all kinds of excited.
_________________
++I;
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Tue Aug 17, 2010 12:32 am    Post subject: Reply with quote

if you use a tag group on the slave like

<master>
<server>....</server> <port>...</port>
<redirect>true</redirect>
<username>...</username>
<password>...</password>
</master>

and optionally <max-redirect-slaves>10</max..> on the master

then the master will 302 new listeners when it is full. At the moment there is no feedback from the slave.

kh26 is up on my site now.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
iunderwood



Joined: 23 Aug 2008
Posts: 114
Location: Leicester, MA

PostPosted: Tue Aug 17, 2010 1:48 am    Post subject: Reply with quote

Upgraded to KH26, and the web interface is returning a lot of 403s:

96.32.118.18 - - [17/Aug/2010:09:40:14 +0000] "GET / HTTP/1.1" 403 51 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-us) AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8" 0

I've backed to KH25 in the meantime.
_________________
++I;
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Tue Aug 17, 2010 1:54 am    Post subject: Reply with quote

looks like my fix for the admin streams thing was wrong, serves me right for doing changes right at the last moment, checking...

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
iunderwood



Joined: 23 Aug 2008
Posts: 114
Location: Leicester, MA

PostPosted: Tue Aug 17, 2010 2:13 am    Post subject: Reply with quote

I'm playing with the master/slave thing as well, and would it be possible to put in the Manage Relays tab which would show known slaves?
_________________
++I;
Back to top
View user's profile Send private message
iunderwood



Joined: 23 Aug 2008
Posts: 114
Location: Leicester, MA

PostPosted: Tue Aug 17, 2010 2:21 am    Post subject: Reply with quote

And another strange bug while we're on a roll.

I've tried to set max_listeners for a certain mount to 0, to force it to redirect:

Code:
    <mount>
      <mount-name>pf-32k.aacp</mount-name>
      <max-listeners>0</max-listeners>
    </mount>


However, the admin page says max_listeners is unlimited. Even does so when I change max to 1.

EDIT:

I'm no C guru, but it looks like defaults are set after the struct in cfgfile.c in static int _parse_mount.
_________________
++I;
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Tue Aug 17, 2010 2:51 am    Post subject: Reply with quote

that one isn't my bug, you forgot the / in the mountpoint

I've re-uploaded the kh26 tarball if you want to try it again.

Yes those are the defaults, before the parse_xml_tags call

karl
Back to top
View user's profile Send private message Send e-mail Visit poster's website
iunderwood



Joined: 23 Aug 2008
Posts: 114
Location: Leicester, MA

PostPosted: Tue Aug 17, 2010 3:07 am    Post subject: Reply with quote

D-oh! Trailing slash ... ugh.

I'll retry the tarball. Smile

EDIT:

Adding the / fixed the mountpoint. (Okay ... I'm up waay too late as it is). With a max of 0, it redirects after reset as soon as the next slave ping comes in. I know the LB is simplistic, but if there are multiple relays, how does it choose who goes where?

Hidden mounts are no longer listed to the slaves.

Streams are authenticated! (Restarted my browser to clear the PW in cache)
_________________
++I;
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Tue Aug 17, 2010 3:33 am    Post subject: Reply with quote

it's based on random selection at the moment. When feedback from the slave occurs then free slots can be determined. Eventually the /admin/streams polling will go as well in favour of the stats connection as that will report relays immediately and allow other details like yp passwords to migrate.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
iunderwood



Joined: 23 Aug 2008
Posts: 114
Location: Leicester, MA

PostPosted: Tue Aug 17, 2010 3:49 am    Post subject: Reply with quote

And another ODR oddity ... the YP call is updating for all mountpoints, based on last known metadata, which is often stale:

Code:
[2010-08-16  23:43:56] DBUG stats/modify_node_event update "/pf-64k.ogg" yp_currently_playing (Walter Mair - The Battle For Caldberg)
[2010-08-16  23:43:56] DBUG yp/send_to_yp YP touch at http://dir.xiph.org/cgi-bin/yp-cgi succeeded
[2010-08-16  23:43:56] DBUG stats/modify_node_event update "/pf-64k.aacp" yp_currently_playing (Normand Corbeil - Lauren Winter's Main Theme)
[2010-08-16  23:43:57] DBUG yp/send_to_yp YP touch at http://dir.xiph.org/cgi-bin/yp-cgi succeeded
[2010-08-16  23:43:59] DBUG stats/modify_node_event update "/pf-32k.ogg" yp_currently_playing (Walter Mair - The Battle For Caldberg)
[2010-08-16  23:43:59] DBUG yp/send_to_yp YP touch at http://dir.xiph.org/cgi-bin/yp-cgi succeeded
[2010-08-16  23:43:59] DBUG stats/modify_node_event update "/pf-32k.aacp" yp_currently_playing (Yoshihito Yano - Raise Thy Sword)
[2010-08-16  23:43:59] DBUG yp/send_to_yp YP touch at http://dir.xiph.org/cgi-bin/yp-cgi succeeded


The /pf-64k.aacp is the only stream the ODR is relaying, so that is the only metadata that is accurate. I'm not sure where this is on the roadmap, but given your mention of the /admin/streams polling stuff ahead that it's got to be on your roadmap somewhere.
_________________
++I;
Back to top
View user's profile Send private message
iunderwood



Joined: 23 Aug 2008
Posts: 114
Location: Leicester, MA

PostPosted: Tue Aug 17, 2010 1:16 pm    Post subject: Reply with quote

My next question with this setup is with URL authentication.

Does the master attempt authentication before the redirect? If so, is any authentication passed to the slave, or does the slave need to be separately configured to authenticate? I believe I saw an icecast-relay: 1 response which can be used to bypass the redirect, correct?
_________________
++I;
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber