Watching program bandwidth usage in Ubuntu

SNGX1275

Posts: 10,615   +467
I saw this thread and got reminded of something that is bothering me a bit.

I've got an Ubuntu box running torrents for me (Transmission), and if I watch the network usage in System Monitor I get an upstream that is generally over 2x what I have the upstream limited to in Transmission. I know there should be some overhead in there, but when Transmission is limited to 27kB/sec up and I see 70KiB/sec up regularly in System Monitor I know something doesn't sound right.

On a clean boot, launching only Transmission, I get this issue. I'm barely even a novice in linux so there exists a real possibility I'm missing something obvious here.
 
If I recall correctly you can set how much bandwidth Transmission uses - by default it will use as much as is available. You could also enable QOS on your router if it supports it.
 
caravel - I have done that. The thing is I capped it at 27, but I can watch System Monitor say I'm sending out up to 70 at times (and its never below 40). I ran Transmission on OS X and I'm pretty sure Activity Monitor showed the same bandwidth as Transmission.

Not running Transmission in OS X anymore cause my torrent drive died (external FW400) and until I can replace the drive my only other viable option is to run an older USB 2 external, and the Mac I was using for Torrents is a PowerMac G4 533Mhz and doesn't have USB 2.0 :)

Leeky - thanks for the link, I'll definately install one of those when I get a chance.
 
Well I ran one of those programs, got the same results as what System Monitor said. So, it seems I'm getting an accurate result on my upstream. But why is the upstream so much higher than what Transmission is capped at and what Transmission is reporting? I know there should be some overhead, but like I said, I wasn't seeing anything like this in OS X.
 
Consider: Why limit bandwidth when there is no other competition for the link?

I'm not saying how it does or does not work, but if I were to write a tool like this,
I would apply user limits to the send/receive only
  • if there were more than one application actively using the link and
  • if the link was close to saturation (ie > 65% of the rated NIC capability).
Sometimes due to the architecture of the application, it can not get anywhere close to saturating the link, so why interfere.
I've seen professional software look really silly throttling back when there's only one user of the resource :)
 
I need it realistically capped at about 40kilobytes/sec. I have 6Mbps down and 512kbps up, if I saturate my upstream my downstream completely craps itself. I leave a bit of headroom left (24kb/sec) so my 'everyday' usage doesn't suffer if I need to use a little upstream.

So originally I had Transmission capped at 40 (which is what I had it at in OS X with no problems), but was noticing some real problems with my download speeds on other computers (even when Transmission wasn't downloading anything, only seeding). At first I just attributed this to local neighborhood cable problems (there are known issues with speeds here, and they are replacing lines next month). But I decided to take a look at what Ubuntu thought was going out, it should be pretty close to what Transmission reports. Turns out it isn't, so I have to drop my upstream in Transmission to the 20s to try and reign in the total upstream coming out of that box, if I set it to 40 it will burst into the 100s, which is totally unacceptable.
 
What I really wanted to know is if there was a way to watch each program's usage, rather than the total output. You know, kind of like how 'top' shows CPU usage for each program.

Hopefully it won't be a big deal in a few days, because I got a new hard drive, so I'll probably just run Transmission on OS X. That way what the program is capped at is actually what it sends out. The way it is now the outstream of the computer is far exceeding the cap I set on Transmission, and I was hoping to see whether Transmission was actually responsible or if something else was involved.
 
Have you tried setting the cap even lower, to see if you can reduce it to acceptable levels that way mate?
 
Yep, I've lowered it into the 20s and everything works properly there. But I shouldn't have to set it that low :)
 
I used to get these bandwidth problems under earlier versions of Ubuntu and the current Debian stable in the past, but was never able to pin down the cause.

I haven't reconfigured anything, though I now run Debian Sid, but never get this problem now. I think it might have been something to do with my router, but I can't remember changing any settings there either. The symptoms I had were much like yours and downloading with apt or through a browser would give the same results - i.e. almost all network bandwidth used. Other machines on the network were also affected.
 
Back