월간 인기 게시물

게시물 160건
   
Trickle - 어플리케이션에 따른 속도제한
글쓴이 : 최고관리자 날짜 : 2015-10-02 (금) 13:09 조회 : 3445
글주소 :
                          

http://www.tuxradar.com/content/control-your-bandwidth-trickle
http://monkey.org/~marius/trickle/trickle.pdf


INSTALL
CentOS (Enable EPEL Repository)
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
# yum install trickle

Ubuntu
# apt-get install aptitude
# apt-get install trickle


Trickle이 원하는 바이너리 파일과의 작동 여부 확인
#  ldd $(which ncftp) | grep libc.so
libc.so.6 => /lib64/libc.so.6 (0x00007fa499fa5000)

# ldd $(which wget ) |grep libc.so
libc.so.6 => /lib64/libc.so.6 (0x0000003620c00000)

# ldd $(which scp) | grep libc.so
libc.so.6 => /lib64/libc.so.6 (0x00007f0d0afd6000)


Bandwidth 테스트 
 :: 테스트할 어플리케이션은 ftp , wget 

Standalone Mode
WGET 제한없이 사용


WGET 다운로드 속도제한 100KB/S


FTP 제한없이 사용
# ncftpput -u mojily -p xxxxxxxxx chonnom.com /home/mojily setup.ini


FTP 업로드 속도제한 200KB/S
# trickle -s -u 200 ncftpput -u mojily -p xxxxxxxxx chonnom.com /home/mojily setup.ini

※ trickle Usage
Usage: trickle [-hvVs] [-d <rate>] [-u <rate>] [-w <length>] [-t <seconds>]
               [-l <length>] [-n <path>] command ...
-h           Help (this)
-v           Increase verbosity level
-V           Print trickle version
-s           Run trickle in standalone mode independent of trickled
-d <rate>    Set maximum cumulative download rate to <rate> KB/s
-u <rate>    Set maximum cumulative upload rate to <rate> KB/s
-w <length>  Set window length to <length> KB 
-t <seconds> Set default smoothing time to <seconds> s
-l <length>  Set default smoothing length to <length> KB
-n <path>    Use trickled socket name <path>
-L <ms>      Set latency to <ms> milliseconds
-P <path>    Preload the specified .so instead of the default one


Supervised [unmanaged] Mode
# trickled -d 1000 -u 1000
# ps -ef |grep trickled |grep -v grep
root     29719     1  0 18:19 ?        00:00:00 trickled -d 1000 -u 1000

속도제한이 걸리긴 하지만....Upload / Download 값이 제대로 반영은 안되는듯;;; (OS : CentOS 6.X X86_64, Ubuntu 14.04 LTS)
# trickle wget http://ftp.daumkakao.com/cygwin/x86_64/setup.ini
# trickle ncftpput -u mojily -p xxxxxxxxx chonnom.com /home/mojily setup.ini 

※ trickled Usage
Usage: trickled [-hvVfs] [-d <rate>] [-u <rate>] [-t <seconds>] [-l <length>]
                [-p <priority>] [-c <file>] [-n <path>] [-N <seconds>]
                [-w <length>]
-h            Help (this)
-v            Increase verbosity level
-V            Print trickled version
-f            Run trickled in the foreground
-s            Use syslog instead of stderr to print messages
-d <rate>     Set maximum cumulative download rate to <rate> KB/s
-u <rate>     Set maximum cumulative upload rate to <rate> KB/s
-t <seconds>  Set default smoothing time to <seconds> s
-l <length>   Set default smoothing length to <length> KB
-p <priority> Set default priority to <priority>
-c <file>     Use configuration file <file>
-n <path>     Set socket name to <path>
-N <seconds>  Notify of bandwidth usage every <seconds> s
-w <length>   Set window size to <length> s


/etc/trickled.conf 설정정의
[service] : 사용하고자 하는 어플리케이션 이름
Priority : 우선순위
Time-Smoothing [초] 
Length-Smoothing [KB] : default 10KB

example) 
# cat /etc/trickled.conf 
[ssh]
Priority = 1
Time-Smoothing = 0.1
Length-Smoothing = 2

[ftp]
Priority = 2
Time-Smoothing = 1
Length-Smoothing = 3

이름 패스워드
비밀글 (체크하면 글쓴이만 내용을 확인할 수 있습니다.)
왼쪽의 글자를 입력하세요.
   

 



 
사이트명 : 모지리네 | 대표 : 이경현 | 개인커뮤니티 : 랭키닷컴 운영체제(OS) | 경기도 성남시 분당구 | 전자우편 : mojily골뱅이chonnom.com Copyright ⓒ www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.