Slow Down Streaming?

Need help? Post your questions here.

Moderator: moderators

Slow Down Streaming?

Postby SmplyUnprdctble » Tue May 03, 2011 8:04 pm

I have Subsonic (4.4) running on a Linux (Ubuntu; Maverick) box using Tomcat6 connected to my Gigabit LAN, and streaming out of my WAN.

Unfortunately, I'm stuck on DSL (Cable wasn't working in my house, and I haven't been able to determine if UVerse will let me do my port forwarding, so I won't pay the $150 installation fee). With DSL, I think I output at like 384k.

Subsonic works BEAUTIFULLY, except when a song starts, everything else associated with my network bogs down to a crawl (I remote into my home network for other things at times, specifically an AIM client).

I found some Linux documentation that will slow down the output of a box, but the quick and dirty script I pulled worked "decent" to keep everything else from slowing down, but it kept navigating pages still slow while a song was playing and even slowed it down when accessing the box internally (and it's not fun when trying to transfer files back and forth to it -- that was fun until I realized what I had done).

I had thought about slowing down port 8080 completely, but that means it's slowed down even when I'm navigating while a song is playing, which isn't what I'm looking for.

Is there a way to throttle back just the stream output? Not the page navigation, and not the whole system. I'd be fine with this being a 'global' setting (I wouldn't see any reason my LAN couldn't be the same throttle as the WAN)

If it helps any, I'm using lighttpd as a proxy (to get http://subsonic.mydyndns.org as the address instead of navigating through ports). But, I can't see anything to slow down streaming in there either.

I can provide more information as requested. I'm fairly savvy

...If stream and page navigation were on different ports, I could see how to do it...

..And I won't mention how jealous I am that I set my sister up a Subsonic server in her home and she can stream video from her Cable connection and I can't from my DSL.. ;-) But, that's another story.
SmplyUnprdctble
 
Posts: 21
Joined: Thu Apr 22, 2010 3:33 pm

Postby GJ51 » Wed May 04, 2011 1:12 am

Go to Settings/Users and set the Max bitrate to an acceptable level.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Postby SmplyUnprdctble » Wed May 04, 2011 1:27 am

Awesome idea! Only, I've tried it.

Thing is it just reduces the length of time the "bandwidth issue" happens. Instead of streaming a 128k mp3 for 60 seconds, it'll stream a 64k mp3 for about 30 seconds. But those 30 seconds are still occupying 100% of the bandwidth
SmplyUnprdctble
 
Posts: 21
Joined: Thu Apr 22, 2010 3:33 pm

Postby GJ51 » Wed May 04, 2011 1:47 am

Understood. You're in a bit of a bind with only 384k up.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Postby SmplyUnprdctble » Wed May 04, 2011 2:27 am

Yeah -- I know my 384 is the bottleneck. I was just hoping for a way to twist the bottleneck a little.

I know I can limit the traffic on port 8080 through my network. I was just hoping there was a way to detect the stream and limit just that. Or a setting that I was missing that would narrow the pipe of the stream.

I'm doing more research and my proxy can supposedly limit bandwidth on a file type or file location -- which means, I believe, if I can tell it "All files that are streaming have XXXXX in the http request, so slow them down." I think that would resolve my conundrum. Lighttpd will slow down the stream request to something "acceptable" on that end and the rest of the pages should stay at "normal" speed.

So, I may alter my question to "Does anyone know what this 'XXXXX' is that would uniquely identify the streaming HTTP request?"
SmplyUnprdctble
 
Posts: 21
Joined: Thu Apr 22, 2010 3:33 pm

Postby GJ51 » Wed May 04, 2011 2:59 am

You can actually get some decent results using ogg 64kbps which might help a little, but it's still probably the same thing, they just transfer faster.

XXXXXXX = "Subsonic" ???
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Postby SmplyUnprdctble » Wed May 04, 2011 1:05 pm

AHA!

I probably wouldn't have gotten the ideas without talking it through in the forum. But I resolved it!

And, to help people in the future on crappy DSL connections, I'm going to supply my configuration. (Provided they use a setup similar to mine)

I have a dyndns account -- we'll call it "myip.dyndns.org" (No, that's not the real dyndns name, but it keeps people from trying to pound my server). I have Wildcards enabled on my account, so my setup allows me to use the address of subsonic.myip.dyndns.org instead of myip.dyndns.org:8080 (lighttpd reverse proxy -- can do the same with Apache, but lighttpd was installed on my GuruPlug already).

I also have Subsonic running on Tomcat6 as the ROOT application. First because I don't have any other .war applications, and secondly it affords me the ability to not have to do any URL translations in the reverse proxy.

So, web traffic works as follows:
subsonic.myip.dyndns.org => lighttpd -> internalip:8080/

After getting further in the lighttpd documentation, I learned you can enable a /server-status area and I learned that the URL that is being called contains "stream?"

To verify that this is what I needed, I created a condition that allowed me to block "stream?" and tested it -- lo and behold, I couldn't get any music. The rest of the application was working as expected (Navigation and that). The first part of my quest has been resolved (finding the XXXXX).

Armed with that knowledge, and the power of Google, I continued on my quest. I learned about connection.kbytes-per-second. Only, at first I was trying it wrong (I was reading kbytes as kbits for some reason and wondering why it was still slow), then I was reading the subsonic output wrong (It's still streaming to the lighttpd server at full speed).

Anyways, here's the snippet from my lighttpd configuration:

Code: Select all
$HTTP["host"] =~ "subsonic" {
  proxy.server  = ( "" =>
                    (
                       ( "host" => "192.168.16.11",
                         "port" => 8080 )
                    )
                  )
  $HTTP["url"] =~ "^/stream?" {
          server.kbytes-per-second = 64
          connection.kbytes-per-second = 12
                 }
}


What it's doing is:
- If the hostname contains the word "subsonic" (I'm lazy and created a hostname at home of 'subsonic' instead of having to do the full address also), we use this "Virtual host" configuration.
- The proxy.server line says how the Reverse Proxy is being handled. No big translation except changing the host and port in the URL as it passes through.
- Then we look to see if "stream?" is included in the URL. If it is, handle that at a different speed. I probably don't need the server.kbytes-per-second line since it's just me accessing, but the second says that any stream can't go faster than 12 kilobytes-per-second (which is 96 kilobits-per-second)

It slows down the stream so the rest of my connections don't drag for the stream download time. It may not be at it's sweet spot yet (and everyone's DSL configuration is probably going to be different to find the sweet spot), but I definitely have a start.

...although I just realized that the video streaming is probably going to be affected in my internal network. I guess I'll have to research on how to do conditions based on IP range...

When I get everything at full sweet spots, I'll get a tutorial on one of my blog sites and see if I can get it linked for others who may be interested in either throttling, or learning how to use lighttpd or Apache as a reverse proxy for Subsonic to reduce the number of open ports in a router.

Thanks for letting me bounce things off of you, GJ!
SmplyUnprdctble
 
Posts: 21
Joined: Thu Apr 22, 2010 3:33 pm

Postby GJ51 » Wed May 04, 2011 3:22 pm

Congrats! Nice bit of troubleshooting. Glad to see you've solved it and looking forward to the tutorial.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Postby SmplyUnprdctble » Thu May 05, 2011 6:13 pm

As promised, Tutorial:

http://rodentstech.blogspot.com/2011/05 ... sonic.html

And, the powers that be have permission to link to this tutorial if they would like. There's other posts on the blog about Subsonic (both direct and indirect). It's not meant to be solely Subsonic, so I wouldn't suggest linking to the top level of the blog.

It DOES kinda show how to bypass one of the premium features ("custom hostname") via Reverse Proxy, but I think anyone who would be going to this level of work probably already would know how to get around it.

As always, any and all comments are welcome.
SmplyUnprdctble
 
Posts: 21
Joined: Thu Apr 22, 2010 3:33 pm

Re: Slow Down Streaming?

Postby MichaelCampbell » Fri Aug 19, 2011 12:21 am

> Unfortunately, I'm stuck on DSL (Cable wasn't working in my house, and I haven't been able to determine if UVerse will let me do my port forwarding, so I won't pay the $150 installation fee). With DSL, I think I output at like 384k.

You can port forward with uVerse. I use a different router between the AT&T provided one and my LAN, but here's the instructions for that, which gives some info on port forwarding also: http://forums.att.com/t5/Residential-Ga ... -p/2707013
MichaelCampbell
 
Posts: 17
Joined: Sat Oct 09, 2010 2:20 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 24 guests