From: Tristan Miller on
Greetings.

There exists the "nice" command which schedules processes with lower CPU
priority, and the "ionice" command to give processes lower I/O priority.
These prevent processes from hogging the CPU or disk.

Is there a similar command for giving a process lower network priority? I
don't mean just throttling the bandwidth to a fixed level, but actually
letting a process use as much bandwidth as it wants provided that no other
higher-priority process is trying to upload or download something. This
sort of thing would be very useful to use in conjunction with software
updaters, BitTorrent clients, large rsync jobs, etc. that one would want to
run in the background and not disrupt one's web browsing experience.

Regards,
Tristan

--
_
_V.-o Tristan Miller >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=- <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
From: J G Miller on
On Mon, 01 Feb 2010 12:05:43 +0000, Tristan Miller wrote:

> This sort of thing would be very useful to use in conjunction with
> software updaters, BitTorrent clients, large rsync jobs, etc.

There are two approaches to this problem.

You can use eg a BitTorrent client which allows you to adjust the
bandwidth usage eg Deluge or Transmission, the latter even having the
feature of a button to click to go to a Turtle mode for when you
just need most of the bandwidth for immediate use by something else,
and eg for rsync use the --bwlimit=KBPS command line flag.

The other approach is to use QOS tuning on your router or iptables
implementation. See the iptables manual page for the CLASSIFY
directive.

This is rather more complicated and laborious to implement but is
the way to "enforce" limits on recalcitrant users whether or not
they implement the "voluntary" approach via the program settings
mentioned above.
From: Tristan Miller on
Greetings.

In article <1265033701_57(a)vo.lu>, J G Miller wrote:

> On Mon, 01 Feb 2010 12:05:43 +0000, Tristan Miller wrote:
>
>> This sort of thing would be very useful to use in conjunction with
>> software updaters, BitTorrent clients, large rsync jobs, etc.
>
> There are two approaches to this problem.
>
> You can use eg a BitTorrent client which allows you to adjust the
> bandwidth usage eg Deluge or Transmission, the latter even having the
> feature of a button to click to go to a Turtle mode for when you
> just need most of the bandwidth for immediate use by something else,
> and eg for rsync use the --bwlimit=KBPS command line flag.
>
> The other approach is to use QOS tuning on your router or iptables
> implementation. See the iptables manual page for the CLASSIFY
> directive.
>
> This is rather more complicated and laborious to implement but is
> the way to "enforce" limits on recalcitrant users whether or not
> they implement the "voluntary" approach via the program settings
> mentioned above.

Doesn't iptables work on a per-port or per-protocol basis? If so, that
approach doesn't really solve my problem, since there will be some HTTP
connections (like YaST's software updater) I want "niced" and others (like
my web browser) which I don't. How is iptables going to know which is
which?

Also, your solution for rsync isn't applicable. I don't want to fix the
bandwidth limit; I want it to dynamically adjust itself, taking all the
bandwidth when possible and cutting back when higher-priority processes are
using it.

Regards,
Tristan

--
_
_V.-o Tristan Miller >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=- <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
From: Jon Solberg on
On 2010-02-01, Tristan Miller <psychonaut(a)nothingisreal.com> wrote:
> Greetings.
>
> There exists the "nice" command which schedules processes with lower CPU
> priority, and the "ionice" command to give processes lower I/O priority.
> These prevent processes from hogging the CPU or disk.
>
> Is there a similar command for giving a process lower network
> priority? I don't mean just throttling the bandwidth to a fixed
> level, but actually letting a process use as much bandwidth as it
> wants provided that no other higher-priority process is trying to
> upload or download something. This sort of thing would be very useful
> to use in conjunction with software updaters, BitTorrent clients,
> large rsync jobs, etc. that one would want to run in the background
> and not disrupt one's web browsing experience.

Not exactly what you're asking for, but I've previously used
http://lartc.org/wondershaper/ with great success to let my interactive
ssh sessions (e.g. decrease latency) get priority over bulk downloads

However, it hasn't been updated in a _long_ time and I'm not even sure
it helps much today.

--
Jon Solberg (remove "nospam." from email address).
From: J G Miller on
On Mon, 01 Feb 2010 15:03:56 +0000, Tristan Miller wrote:

> How is iptables going to know which is which?

How do you know which is which and how does your broswer know which
is which and YasT know which is which?

You would have to configure IPTABLES to use a combined rule limiting the
urgency of packets which are of both type HTTP and coming from the
address of the YaST repository.

> I want it to dynamically adjust itself, taking all the bandwidth
> when possible and cutting back when higher-priority processes
> are using it.

So you are looking for a automagical-does-all-I-want wonder tool.

Have you done a web search using such terms as "bandwidth limiter",
"traffic shaper", etc?

If you cannot find anything suitable they you are going to have to write
the software yourself.