rsync 전송 대역폭 제한
작성자 : neosky (seroot.com, nple.com)
작성일자 : 2010. 05. 06.
rsync 를 이용한 a서버와 b서버간 데이터 동기화시
아무런 제한사항을 두지 않게 되면 거의 max 값의 대역폭을 사용하여 전송하게 된다.
트래픽 사용에 영향을 미치게 되어, 정상적인 서비스를 못할 수도 있다.
이럴 때 rsync 에 다운로드 받는 대역폭을 조절하는 옵션을 사용한다면
rsync 의 man 페이지를 살펴보면 아래와 같은 내용이 발견될 것이다.
즉, 위 옵션은 limit I/O bandwidth, KBytes per second 으로 정리될 수 있겠다.
다음과 같은 명령으로 b서버에서 a서버 데이터를 동기화하는 명령을 쓸 수 있으며,
a서버의 homedata 라는 곳의 데이터를 b서버의 /home/data 위치로 동기화 시키면서,
데이터 전송속도는 500KBps 으로 하고, (--bwlimit=500) 동기화할때 a서버에서 삭제한 파일이
b서버에서도 삭제하고, (--delete) 동기화 상태를 보여주도록 하라 (--progress)는 의미.
위 그래프는 실제 동기화시 a서버에서 발생한 트래픽을 MRTG에서 캡쳐한 화면으로
MRTG 그래프에서의 단위는 Kbps 이고, rsync 는 KBps 이므로 다음과 같이 계산할 수 있겠다.
500 * 8bit = 4Mbps +기본 트래픽 0.4Mbps = 최종 트래픽 4.4Mbps
작성자 : neosky (seroot.com, nple.com)
작성일자 : 2010. 05. 06.
rsync 를 이용한 a서버와 b서버간 데이터 동기화시
아무런 제한사항을 두지 않게 되면 거의 max 값의 대역폭을 사용하여 전송하게 된다.
트래픽 사용에 영향을 미치게 되어, 정상적인 서비스를 못할 수도 있다.
이럴 때 rsync 에 다운로드 받는 대역폭을 조절하는 옵션을 사용한다면
rsync 의 man 페이지를 살펴보면 아래와 같은 내용이 발견될 것이다.
--bwlimit=KBPS
This option allows you to specify a maximum transfer rate in kilobytes per second.
This option is most effective when using rsync with large files (several megabytes and up).
Due to the nature of rsync transfers, blocks of data are sent, then if rsync determines the transfer was too fast,
it will wait before sending the next data block. The result is an average transfer rate equaling the specified limit.
A value of zero specifies no limit.
This option allows you to specify a maximum transfer rate in kilobytes per second.
This option is most effective when using rsync with large files (several megabytes and up).
Due to the nature of rsync transfers, blocks of data are sent, then if rsync determines the transfer was too fast,
it will wait before sending the next data block. The result is an average transfer rate equaling the specified limit.
A value of zero specifies no limit.
즉, 위 옵션은 limit I/O bandwidth, KBytes per second 으로 정리될 수 있겠다.
다음과 같은 명령으로 b서버에서 a서버 데이터를 동기화하는 명령을 쓸 수 있으며,
a서버의 homedata 라는 곳의 데이터를 b서버의 /home/data 위치로 동기화 시키면서,
데이터 전송속도는 500KBps 으로 하고, (--bwlimit=500) 동기화할때 a서버에서 삭제한 파일이
b서버에서도 삭제하고, (--delete) 동기화 상태를 보여주도록 하라 (--progress)는 의미.
rsync -avz --progress --delete --bwlimit=500 xxx.xxx.xxx.xxx::homedata /home/data

MRTG 그래프에서의 단위는 Kbps 이고, rsync 는 KBps 이므로 다음과 같이 계산할 수 있겠다.
500 * 8bit = 4Mbps +기본 트래픽 0.4Mbps = 최종 트래픽 4.4Mbps


당신의 의견을 작성해 주세요.