[linux] trickle 대역폭 제한

주로 ftp, rsync를 이용하여 데이터가 이동하는데 이런 프로그램의 대역폭을 trickle 프로그램으로

조절이 가능하다.

설치

root@smileserv-desktop:~# apt-get install trickle

패키지 목록을 읽는 중입니다완료

의존성 트리를 만드는 중입니다       

상태 정보를 읽는 중입니다완료

다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다:

  linux-image-3.13.0-66-generic linux-image-3.13.0-68-generic

  linux-image-3.13.0-70-generic linux-image-3.13.0-71-generic

  linux-image-3.13.0-73-generic linux-image-3.13.0-74-generic

  linux-image-3.13.0-76-generic linux-image-extra-3.13.0-66-generic

  linux-image-extra-3.13.0-68-generic linux-image-extra-3.13.0-70-generic

  linux-image-extra-3.13.0-71-generic linux-image-extra-3.13.0-73-generic

  linux-image-extra-3.13.0-74-generic linux-image-extra-3.13.0-76-generic

Use ‘apt-get autoremove’ to remove them.

다음 새 패키지를 설치할 것입니다:

  trickle

0개 업그레이드, 1개 새로 설치, 0개 제거 및 116개 업그레이드 안 함.

0 바이트/34.6 k바이트 아카이브를 받아야 합니다.

이 작업 후 158 k바이트의 디스크 공간을 더 사용하게 됩니다.

Selecting previously unselected package trickle.

(데이터베이스 읽는중현재 648717개의 파일과 디렉터리가 설치되어 있습니다.)

Preparing to unpack …/trickle_1.07-10ubuntu2_amd64.deb …

Unpacking trickle (1.07-10ubuntu2) …

Processing triggers for man-db (2.6.7.1-1ubuntu1) …

trickle (1.07-10ubuntu2) 설정하는 중입니다

# debian 계열 ubuntu 14.04 에서 apt-get install 명령어로 쉽게 설치가 가능하다

[root@controller ~]#  yum install epel-release

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: data.nicehosting.co.kr

 * extras: ftp.daumkakao.com

 * updates: data.nicehosting.co.kr

Resolving Dependencies

–> Running transaction check

—> Package epel-release.noarch 0:7-5 will be installed

–> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================================================

 Package                                                Arch                                             Version                                          Repository                                        Size

=================================================================================================================================================================================================================

Installing:

 epel-release                                           noarch                                           7-5                                              extras                                            14 k

Transaction Summary

=================================================================================================================================================================================================================

Install  1 Package

Total download size: 14 k

Installed size: 24 k

Is this ok [y/d/N]: y

Downloading packages:

epel-release-7-5.noarch.rpm                                                                                                                                                               |  14 kB  00:00:00

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : epel-release-7-5.noarch                                                                                                                                                                       1/1

  Verifying  : epel-release-7-5.noarch                                                                                                                                                                       1/1

Installed:

  epel-release.noarch 0:7-5

Complete!

[root@controller ~]# yum install trickle

Loaded plugins: fastestmirror

epel/x86_64/metalink                                                                                                                                                                      | 5.3 kB  00:00:00

epel                                                                                                                                                                                      | 4.3 kB  00:00:00

(1/3): epel/x86_64/group_gz                                                                                                                                                               | 169 kB  00:00:00

(2/3): epel/x86_64/primary_db                                                                                                                                                             | 3.9 MB  00:00:00

(3/3): epel/x86_64/updateinfo                                                                                                                                                             | 493 kB  00:00:05

Loading mirror speeds from cached hostfile

 * base: data.nicehosting.co.kr

 * epel: ftp.riken.jp

 * extras: ftp.daumkakao.com

 * updates: data.nicehosting.co.kr

Resolving Dependencies

–> Running transaction check

—> Package trickle.x86_64 0:1.07-19.el7 will be installed

–> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================================================

 Package                                           Arch                                             Version                                                 Repository                                      Size

=================================================================================================================================================================================================================

Installing:

 trickle                                           x86_64                                           1.07-19.el7                                             epel                                            48 k

Transaction Summary

=================================================================================================================================================================================================================

Install  1 Package

Total download size: 48 k

Installed size: 103 k

Is this ok [y/d/N]: y

Downloading packages:

warning: /var/cache/yum/x86_64/7/epel/packages/trickle-1.07-19.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY

Public key for trickle-1.07-19.el7.x86_64.rpm is not installed

trickle-1.07-19.el7.x86_64.rpm                                                                                                                                                            |  48 kB  00:00:00

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Importing GPG key 0x352C64E5:

 Userid     : “Fedora EPEL (7) <epel@fedoraproject.org>”

 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5

 Package    : epel-release-7-5.noarch (@extras)

 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Is this ok [y/N]: y

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : trickle-1.07-19.el7.x86_64                                                                                                                                                                    1/1

  Verifying  : trickle-1.07-19.el7.x86_64                                                                                                                                                                    1/1

Installed:

  trickle.x86_64 0:1.07-19.el7

Complete!

# redhat 계열 CentOS 7에서는 epel repository를 설치하고 yum 설치가 가능하다.

– ftp 트래픽 조절

# trickle 사용전

root@smileserv-desktop:~# lftp -u SND xxx.xxx.xxx.xxx

비밀번호

lftp SDN@xxx.xxx.xxx.xxx:~> cd smileserv/Linux_iso/    

lftp SDN@xxx.xxx.xxx.xxx:~/smileserv/Linux_iso> get CentOS\ 7\ x86_64-0.iso

`CentOS 7 x86_64-0.iso’ at 132024912 (3%) 9.19M/초 남은시간:7m [자료 받는 중]

# trickle 사용후

root@smileserv-desktop:~# trickle -s -u 1000 -d 1000 lftp -u SND 211.55.113.55

lftp SDN@xxx.xxx.xxx.xxx:~> cd smileserv/Linux_iso/

lftp SDN@xxx.xxx.xxx.xxx:~/smileserv/Linux_iso> get -c CentOS\ 7\ x86_64-0.iso

`CentOS 7 x86_64-0.iso’ at 192482168 (4%) 1.07M/초 남은시간:61m [자료 받는 중]

# 사용법은 명령어 전에 trickle을 붙여주는 것이며 -u, -d옵션으로 Kbyte 단위의 업, 다운로드

 대역폭 할당이 가능하다.

글쓴이