(E-Mail Removed) wrote:
> Is there a utility in existance that allows one to 'renice' a connection
> or, better yet all connections a given process is using?
>
> Something like:
>
> nrenice 10 1251
Unfortunately, no, though it would be possible to do this in a couple of
ways.
1) Using LD_PRELOAD wrapper for the recv/send and read/write system
calls, you could control bandwidth by waiting a bit after processing the
request. This is a bit of a rude hack, and you'd need to be careful of
deferentiating between network sockets and files. Also, it would have to
be run as a wrapper program, you couldn't _re_nice something, only
_nice_ it.
2) Using strace(2) system call, you may be able to tie into the
firewalling code of the kernel to insert rules to match on process ID,
and some traffic control. That would be very advanced, Linux specific,
and require root priviledge (or at least some capabilities that would
have be granted by root).
> the nrenice would then tell the kernel to slow down the connections used by
> process ID 1251 by a 10 level. (with 0 being normal -19 being "hog
> everything" etc.. just like the nice command does)
>
> Just curious if anyone has heard of such a thing. I don't actually need it
> for anything, it'd be, ah, well 'nice' :-)
I know the feeling. You may be interested in WonderShaper.
--
Cameron Kerr
(E-Mail Removed) :
http://nzgeeks.org/cameron/
Empowered by Perl!