{"action":"created","issue":{"url":"https://api.github.com/repos/yadayada/acd_cli/issues/55","labels_url":"https://api.github.com/repos/yadayada/acd_cli/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/yadayada/acd_cli/issues/55/comments","events_url":"https://api.github.com/repos/yadayada/acd_cli/issues/55/events","html_url":"https://github.com/yadayada/acd_cli/issues/55","id":82935443,"number":55,"title":"Bandwidth rate limting","user":{"login":"edgan","id":3506737,"avatar_url":"https://avatars.githubusercontent.com/u/3506737?v=3","gravatar_id":"","url":"https://api.github.com/users/edgan","html_url":"https://github.com/edgan","followers_url":"https://api.github.com/users/edgan/followers","following_url":"https://api.github.com/users/edgan/following{/other_user}","gists_url":"https://api.github.com/users/edgan/gists{/gist_id}","starred_url":"https://api.github.com/users/edgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgan/subscriptions","organizations_url":"https://api.github.com/users/edgan/orgs","repos_url":"https://api.github.com/users/edgan/repos","events_url":"https://api.github.com/users/edgan/events{/privacy}","received_events_url":"https://api.github.com/users/edgan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yadayada/acd_cli/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-30T22:46:19Z","updated_at":"2015-05-31T20:24:11Z","closed_at":null,"body":"acd_cli needs bandwidth rate limiting. I have 20mbit, but I don't want to use 100% of it 24/7 if I have a huge upload."},"comment":{"url":"https://api.github.com/repos/yadayada/acd_cli/issues/comments/107241624","html_url":"https://github.com/yadayada/acd_cli/issues/55#issuecomment-107241624","issue_url":"https://api.github.com/repos/yadayada/acd_cli/issues/55","id":107241624,"user":{"login":"edgan","id":3506737,"avatar_url":"https://avatars.githubusercontent.com/u/3506737?v=3","gravatar_id":"","url":"https://api.github.com/users/edgan","html_url":"https://github.com/edgan","followers_url":"https://api.github.com/users/edgan/followers","following_url":"https://api.github.com/users/edgan/following{/other_user}","gists_url":"https://api.github.com/users/edgan/gists{/gist_id}","starred_url":"https://api.github.com/users/edgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgan/subscriptions","organizations_url":"https://api.github.com/users/edgan/orgs","repos_url":"https://api.github.com/users/edgan/repos","events_url":"https://api.github.com/users/edgan/events{/privacy}","received_events_url":"https://api.github.com/users/edgan/received_events","type":"User","site_admin":false},"created_at":"2015-05-31T20:24:11Z","updated_at":"2015-05-31T20:24:11Z","body":"Here is the best workaround I found. It restricts by user, so best to create a new user just for this purpose. The user also needs to be able to read the files.\r\n\r\nI tried trickle, but it doesn't work with acd_cli. I would use wondershaper, but then that would limit all uploads from the machine. Which is especially bad if there is only one network interface.\r\n\r\n\r\nadduser acd\r\nrate_limit_by_user eth0 1Gbit 16Mbit acd\r\nsu - acd\r\nacd_cli upload foo/ /bar/\r\n\r\n\r\nUsage:   ./rate_limit_by_user interface interface_speed upload_limit username\r\nExample: ./rate_limit_by_user eth0 1Gbit 16Mbit acd\r\n\r\nrate_limit_by_user:\r\n#!/bin/bash\r\n\r\nINTERFACE=$1\r\nINTERFACE_SPEED=$2\r\nUPLOAD_LIMIT=$3\r\nUSER=$4\r\n\r\ntc qdisc add dev $INTERFACE root handle 2:0 htb default 99\r\ntc class add dev $INTERFACE parent 2:0 classid 2:1 htb rate $INTERFACE_SPEED ceil $INTERFACE_SPEED\r\ntc class add dev $INTERFACE parent 2:1 classid 2:11 htb rate $UPLOAD_LIMIT ceil $UPLOAD_LIMIT prio 2\r\ntc qdisc add dev $INTERFACE parent 2:11 handle 20: sfq perturb 10\r\n\r\niptables -t mangle -A OUTPUT -p tcp -m owner --uid-owner $USER -j CLASSIFY --set-class 2:11"}}