当前位置: 首页 > news >正文

【Linux 带宽限速】trickle,限制docker 上传速度

限制docker 上传速度

然而,你可以使用第三方工具来实现这个目的。一个常用的工具是 trickle,它可以模拟网络带宽。

首先,你需要安装 trickle。在 Ubuntu 上,可以使用以下命令安装:

sudo apt-get install trickle

然后,你可以使用 trickle 来限制 Docker 推送的速度。例如:

trickle -s -u 300 docker push kevinchina/deeplearning:CodeFormerv1.000

在这个例子中,-u 300 表示将带宽限制为每秒 300KB。你可以根据需要调整这个值。

请注意,这种方法并不是 Docker 的原生功能,而是通过使用额外的工具来实现的。

https://blog.desdelinux.net/en/trickle-bandwidth-limiter-for-linux/

Installation
sudo apt-get install trickle
How to use trickle
Trickle’s syntax is as follows:

trickle -d Download_Bandwidth -u Upload_Bandwidth Command
Here are some examples:

a) Limit the download bandwidth to 10kbps used to transfer a file using ssh:

trickle -d 10 scp file.mp3 10.0.0.1:/home/puntolibre/musica/
b) Limit the bandwidth to 200kpbs of download of a system update through Apt:

trickle -d 200 apt-get upgrade
c) To modify the bandwidth of an application, such as Firefox:

trickle -d 10 -u 10 firefox% u
d) Using trickle to limit wget’s bandwidth

trickle -d 50 wget -O “planet earth.divx” http://video.stage6.com/1402821/.divx

Run trickle like a demon
To start trickle like a daemon and limit ALL bandwidth, use the trickled command:

sudo trickled -d 20 -u 20
… Where the parameters -d and -u respond to the download and upload limit, respectively.

Configuring trickle
Trickle has a configuration file that will allow us to fine-tune some parameters and make them permanent individually for each service.

The configuration file is as follows: /etc/trickled.conf

The simplest configuration file that can be made looks like this:

[ssh] Priority = 1

[www] Priority = 8
With this method we get quite good download speeds and at the same time we can do ssh sessions to the machine that is downloading. Basically, a config file like the one above tells trickle to prioritize ssh transfers over www.

Trickle’s documentation recommends the use of the Time-Smoothing and Length-Smoothing parameters to avoid fluctuations in transfer rates.

[ssh] Priority = 1
Time-Smoothing = 0.1
Length-Smoothing = 2

[www] Priority = 8
Time-Smoothing = 5
Length-Smoothing = 20
These values ​​define the normalization time and length that Trickle applies to the program it is controlling.

http://www.lryc.cn/news/248235.html

相关文章:

  • MindStudio学习记录三:推理应用开发 acl mindx sdk
  • 【RT-DETR改进】SIoU、GIoU、CIoU、DIoU、AlphaIoU等二十余种损失函数
  • 【Linux】EVIOCGBIT
  • 鸿蒙4.0开发笔记之ArkTS装饰器语法基础@Extend扩展组件样式与stateStyles多态样式(十一)
  • 5V摄像机镜头驱动IC GC6208,可用于摄像机,机器人等产品中可替代AN41908
  • PHP echo和print 语句
  • ThinkPHP6.1 多应用模式的一些事儿
  • redis-cluster集群模式
  • 带你用uniapp从零开发一个仿小米商场_10. 首页开发
  • 常使用的定时任务
  • 【人工智能Ⅰ】实验2:遗传算法
  • Hadoop集群升级(3.1.3 -> 3.2.4)
  • (一)基于高尔夫优化算法GOA求解无人机三维路径规划研究(MATLAB)
  • ESP32-Web-Server编程-建立第一个网页
  • csgo/steam游戏搬砖项目的五大认知误区
  • ASCII sorting
  • redis--高可用之持久化
  • 『VUE3 の 要点摘录』
  • Buzz库python代码示例
  • Django路由分发
  • 【UGUI】中Content Size Fitter)组件-使 UI 元素适应其内容的大小
  • 第二十章Java博客
  • 实验一 SAS 基本操作和数据表的导入 2023-11-29
  • YOLOv5改进之ShuffleNetV2
  • tcp/ip协议 error=10022 Winsock.reg Winsock2.reg
  • 【Redis基础】Redis基本的全局命令
  • Vite 了解
  • oracle常用通用sql脚本——查询前用户的表空间信息
  • Python内置类属性`__name__`属性的使用教程
  • BUUCTF-pwn-ciscn_2019_ne_51