On Wed, Feb 09, 2005 at 09:48:26PM -0500, Roberto C. Sanchez wrote: > Is there a way to nice the remote end of an ssh or scp session? > I aske because I have two machines. One can fill a 100 Mbps pipe > even enrypting for scp. However, the other is CPU bound and > maxes out at 7 MBps (or ~60 Mbps). I usually initiate connections > from the more powerful machine to the less powerful machine. I > would like to know if I can do this on a per connection basis. > All the information that I have found talks about nicing sshd > (and by extension all of its child processes). However, I am > in interested in a per connection solution. > > Is there a switch to ssh (that is not in the documentation) or > an incantation that will have the remote end of the connection > run at a lower priority or renice itself after starting? running at a lower priority is quiet easy: as you probably guessed: ssh otherbox nice /some/command but that will only lower the CPU priority on the other box - which usually has very little effect on network bandwidth usage... You may want to look into the "iprelay" package: # apt-get install iprelay and then as yourself: $ iprelay -d -b8192 2200:otherbox:22 $ ssh -o HostKeyAlias=otherbox -p 2200 localhost /some/command This would limit the bandwith on the SSH connection to about 8192 bytes/sec... Similar stuff can be used for scp(1). As usual, man(1) is your friend... <div target="WebDesigners"> This also comes in handy under other circumstances; $ iprelay -b2500 8000:localhost:80 # Point browser at http://localhost:8000 and you can see your website creations as a poor modem user would... </div> Hope this helps -- Karl E. Jørgensen karl@jorgensen.com http://karl.jorgensen.com ==== Today's fortune: Alimony is like buying oats for a dead horse. -- Arthur Baer
Attachment:
signature.asc
Description: Digital signature