| Rate Limit sshfs |
Rate Limit sshfsby Jordan Emmorey v0.1 This work is licensed under a Creative Commons License. 0. TOC and Purpose 0. TOC and PurposeThe purpose of this is paper is to document a cryptic procedure for rate limiting sshfs, and explain some of the pertinent terminology. 1. BackgroundI use sshfs to mount my backup directory for my webhost. Backing up this directory drove my home internet connection into the ground which in tern killed my VoIP. I wanted to rate limit the backups, however most utilities only have rate limiting for remote backups. Since sshfs provides a local mount point, these backup utilities do not rate limit. The first thing I learned is that Linux has a built in traffic controller which handles packet queuing before it makes it to the network interface card. The interface is aptly named tc. 2. UseTo see the current traffic control configuration, you can use tc. This tells us that for eth0 the qdisc (short for 'queueing discipline') is FIFO (first in and first out) for the root band. souljah@bluepunx:~$ sudo tc qdisc show To add traffic shaping I found a script from the Ubuntu forums which I modified and tested. See below: DEV=eth0 This script sets a rate limit (throttle) of ~22KiB/s for any traffic to 192.168.10.50 on port 22. You should Modify the SERVER_IP and SSH_UPLOAD to match your network connection and remote host. Important ideas:
You probably do not want to have your combined rates be larger than your available bandwidth. To encourage better quality shaping you can have your rate lower and then cap with a larger ceiling.
3. Resources
4. ContactThanks for reading. If you have any comments, suggestions or gripes please feel free to send them along. I'm always hungry for feedback. Thanks. Contact me via email at This e-mail address is being protected from spambots. You need JavaScript enabled to view it . 5. Keywordsssfsh, rate, limit, rate-limit, throttle, Linux, Ubuntu, server, desktop, 9.10, 9.04, karmic, sshd, bandwidth, 6. DisclaimerObsecurities is furnishing this item "as is". Obsecurities does not provide any warranty of the item whatsoever, whether express, implied, or statutory, including, but not limited to, any warranty of merchantability or fitness for a particular purpose or any warranty that the contents of the item will be error-free. In no respect shall obsecurities incur any liability for any damages, including, but limited to, direct, indirect, special, or consequential damages arising out of, resulting from, or any way connected to the use of the item, whether or not based upon warranty, contract, tort, or otherwise; whether or not injury was sustained by persons or property or otherwise; and whether or not loss was sustained from, or arose out of, the results of, the item, or any services that may be provided by Obsecurities. |