{"id":4214,"date":"2024-11-05T05:50:02","date_gmt":"2024-11-04T20:50:02","guid":{"rendered":"https:\/\/matoken.org\/blog\/?p=4214"},"modified":"2024-11-05T05:50:05","modified_gmt":"2024-11-04T20:50:05","slug":"throttle-the-network-bandwidth-for-a-specific-command-with-the-trickle-command","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2024\/11\/05\/throttle-the-network-bandwidth-for-a-specific-command-with-the-trickle-command\/","title":{"rendered":"trickle\u30b3\u30de\u30f3\u30c9\u3067\u7279\u5b9a\u306e\u30b3\u30de\u30f3\u30c9\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5e2f\u57df\u3092\u7d5e\u308b"},"content":{"rendered":"<p><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"48\" height=\"48\" viewBox=\"0 0 48 48\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"4\" d=\"M15 30a9 9 0 0 1 1.8-5.4l3.6-4.8A3 3 0 0 0 21 18V4h6v14a3 3 0 0 0 .6 1.8l3.6 4.8A9 9 0 0 1 33 30v12a2 2 0 0 1-2 2H17a2 2 0 0 1-2-2zm6-20h6m-6 2V8m6 4V8\"><\/path><\/svg><!-- https:\/\/icon-sets.iconify.design\/icon-park-outline\/bottle-one\/ --><\/p>\n<div class=\"paragraph\">\n<p>\u30b9\u30c8\u30ea\u30fc\u30df\u30f3\u30b0\u30d3\u30c7\u30aa\u3092\u898b\u3066\u3044\u308b\u3068\u304d\u306b\u4ed6\u306e\u901a\u4fe1\u3092\u884c\u3046\u3068\u30d3\u30c7\u30aa\u306e\u753b\u8cea\u304c\u6b62\u307e\u3063\u3066\u3057\u307e\u3044\u30b9\u30c8\u30ec\u30b9\u3067\u3059\uff0e\u30ed\u30fc\u30ab\u30eb\u306b\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u51fa\u6765\u308b\u3082\u306e\u306f\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304b\u3089\u518d\u751f\u3059\u308b\u3053\u3068\u3067\u30b9\u30c8\u30ec\u30b9\u306a\u304f\u8996\u8074\u53ef\u80fd\u3067\u3059\u304c\u305d\u308c\u304c\u3067\u304d\u306a\u3044\u3082\u306e\u3084\u30e9\u30a4\u30d6\u3060\u3068\u3067\u304d\u307e\u305b\u3093\uff0e<br \/>\n\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u3088\u3063\u3066\u306f\u5e2f\u57df\u3092\u7d5e\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u307e\u3059\u304c\u305d\u308c\u304c\u306a\u3044\u3082\u306e\u306f\u4e0d\u4fbf\uff0e\u4eca\u56de <code>trickle<\/code> \u3068\u3044\u3046\u30c4\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u7279\u5b9a\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5e2f\u57df\u3092\u7d5e\u3063\u3066\u307f\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/mariusae\/trickle\">mariusae\/trickle: Trickle is a userland bandwidth shaper for Unix-like systems.<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p><!--more--><\/p>\n<div class=\"paragraph\">\n<p>\u4eca\u56deRaspberry Pi OS bookworm armhf\u74b0\u5883\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u304b\u3089\u5c0e\u5165\u3057\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ sudo apt install trickle\n$ trickle -h\nUsage: trickle [-hvVs] [-d &lt;rate&gt;] [-u &lt;rate&gt;] [-w &lt;length&gt;] [-t &lt;seconds&gt;]\n               [-l &lt;length&gt;] [-n &lt;path&gt;] command ...\n        -h           Help (this)\n        -v           Increase verbosity level\n        -V           Print trickle version\n        -s           Run trickle in standalone mode independent of trickled\n        -d &lt;rate&gt;    Set maximum cumulative download rate to &lt;rate&gt; KB\/s\n        -u &lt;rate&gt;    Set maximum cumulative upload rate to &lt;rate&gt; KB\/s\n        -w &lt;length&gt;  Set window length to &lt;length&gt; KB\n        -t &lt;seconds&gt; Set default smoothing time to &lt;seconds&gt; s\n        -l &lt;length&gt;  Set default smoothing length to &lt;length&gt; KB\n        -n &lt;path&gt;    Use trickled socket name &lt;path&gt;\n        -L &lt;ms&gt;      Set latency to &lt;ms&gt; milliseconds\n        -P &lt;path&gt;    Preload the specified .so instead of the default one<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>wget\u306b\u306f\u5e2f\u57df\u3092\u7d5e\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u307e\u3059( <code>--limit-rate<\/code> )\u304c\u304a\u624b\u8efd\u306a\u306e\u3067\u307e\u305a\u306f\u3053\u308c\u3067\u8a66\u3057\u307e\u3059\uff0e<br \/>\n\u3053\u3053\u3067\u306f <code>-s<\/code> \u3067\u30c7\u30fc\u30e2\u30f3\u3092\u4f7f\u308f\u305a\u30a2\u30c9\u30db\u30c3\u30af\u306b\u5229\u7528\u3057\u307e\u3059\uff0e<br \/>\n<code>-d 30<\/code> \u3068\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3092 <code>30KB\/s<\/code> \u306b\u5236\u9650\u3057\u305f\u306e\u304c\u52b9\u3044\u3066\u3044\u308b\u3088\u3046\u3067\u305d\u308c\u306b\u8fd1\u3044\u901f\u5ea6\u306b\u306a\u3063\u3066\u3044\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ trickle -s -d 30 wget https:\/\/mirrors.edge.kernel.org\/qubes\/iso\/Qubes-R4.2.3-x86_64.iso -O \/dev\/null\n   :\n\/dev\/null               0%[                       ]   2.63M  31.3KB\/s    eta 2d 9h<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u6b21\u306b\u5e2f\u57df\u5236\u9650\u304c\u306a\u3055\u305d\u3046\u306aRaspberryPi\u306eKernel\u3092\u65b0\u3057\u304f\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u8a66\u3057\u307e\u3059\uff0e\u306f\u3058\u3081sudo\u30b3\u30de\u30f3\u30c9\u306e\u524d\u306btrickle\u3092\u7f6e\u304f\u3068\u52b9\u304d\u307e\u305b\u3093\u3067\u3057\u305f\uff0esudo\u306e\u5f8c\u308d\u306btrickle\u3092\u7f6e\u304f\u3053\u3068\u3067\u5e2f\u57df\u5236\u9650\u3067\u304d\u307e\u3057\u305f\uff0e\u3067\u3082\u4eca\u56de\u306f\u63a5\u7d9a\u304c\u5207\u308c\u3066\u3057\u307e\u3044\u307e\u3057\u305f\uff0e\u7a0b\u3005\u306b\u3057\u306a\u3044\u3068\u99c4\u76ee\u307f\u305f\u3044\u3067\u3059\u306d\uff0e\u3082\u3057\u304f\u306fcontinue\u3084retry\u3092\u4f7f\u3046\u3088\u3046\u66f8\u304d\u63db\u3048\u308b\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ sudo trickle -s -d 30 rpi-update\n   :\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\n 15  144M   15 22.9M    0     0  28070      0  1:29:44  0:14:17  1:15:27 30009\ncurl: (56) Recv failure: Connection reset by peer<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3054\u3068\u306e\u5e2f\u57df\u5236\u9650\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u899a\u3048\u304d\u308c\u306a\u3044\u3057\u6bce\u56de\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8abf\u3079\u308b\u306e\u306f\u9762\u5012\uff0e\u3067\u3082trickle\u3060\u3051\u306a\u3089\u899a\u3048\u3089\u308c\u305d\u3046\u3067\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u74b0\u5883<\/div>\n<div class=\"content\">\n<pre>$ dpkg-query -W trickle wget curl\ncurl    8.5.0-2~bpo12+1\ntrickle 1.07-12\nwget    1.21.3-1+b1\n$ lsb_release -dr\nNo LSB modules are available.\nDescription:    Raspbian GNU\/Linux 12 (bookworm)\nRelease:        12\n$ arch\narmv7l\n$ grep ^Model \/proc\/cpuinfo\nModel           : Raspberry Pi 3 Model B Rev 1.2<\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u30b9\u30c8\u30ea\u30fc\u30df\u30f3\u30b0\u30d3\u30c7\u30aa\u3092\u898b\u3066\u3044\u308b\u3068\u304d\u306b\u4ed6\u306e\u901a\u4fe1\u3092\u884c\u3046\u3068\u30d3\u30c7\u30aa\u306e\u753b\u8cea\u304c\u6b62\u307e\u3063\u3066\u3057\u307e\u3044\u30b9\u30c8\u30ec\u30b9\u3067\u3059\uff0e\u30ed\u30fc\u30ab\u30eb\u306b\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u51fa\u6765\u308b\u3082\u306e\u306f\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304b\u3089\u518d\u751f\u3059\u308b\u3053\u3068\u3067\u30b9\u30c8\u30ec\u30b9\u306a\u304f\u8996\u8074\u53ef\u80fd\u3067\u3059\u304c\u305d\u308c\u304c\u3067\u304d\u306a\u3044\u3082\u306e\u3084\u30e9\u30a4\u30d6\u3060\u3068\u3067 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":null,"activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"federated","footnotes":""},"categories":[809,6,546],"tags":[1131,1130],"class_list":["post-4214","post","type-post","status-publish","format-standard","hentry","category-bookworm-raspberry-pi-os","category-linux","category-raspberry-pi-os","tag-bandwidth","tag-trickle"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/4214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=4214"}],"version-history":[{"count":2,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/4214\/revisions"}],"predecessor-version":[{"id":4216,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/4214\/revisions\/4216"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=4214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=4214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=4214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}