메뉴 닫기

rsync 대역폭 제한하기

rsync에 –bwlimit라는 옵션이 있습니다.
원격지에서 백업하다보면 서비스되고 있는 상태 혹은 다중으로 데이터를 전송하면  초당 100Mbit 도 나오고 그럽니다.

그러면 회선비가 감당이 안 되니까
적당하게 그리고 서버에 부하를 안 줄 정도로(limit I/O bandwidth) 초당 전송 속도를 제어할 수 있습니다.

[옵션]
–bwlimit=KBPS

[설명]
limit I/O bandwidth, KBytes per second

1G 파일을 생성한후
[root@test ~ ]# dd if=/dev/zero of=test1G count=1024000 bs=1024

1024000+0 records in
1024000+0 records out
1048576000 bytes (1.0 GB) copied, 3.77769 s, 278 MB/s

[root@test ~ ]# du -sh test1G
1001M test1G

 

옵션없이 실행하였을때 대역폭은  3,834,384.29 bytes/sec 로 초당 3M가 정도 나옵니다.

[root@test2 ~]# time rsync -v 192.168.9.50:test1G .
test1G
sent 30 bytes received 1048704102 bytes 3,834,384.29 bytes/sec
total size is 1048576000 speedup is 1.00

real 4m32.970s
user 0m13.456s
sys 0m8.218s

파일을 rsync를 옵션을 주어 받아옵니다. (속도는 초당 1M로 설정)   1,019,644.24 bytes/sec 초당  1M 정도 나오는걸 볼수 있습니다.
[root@test2 ~]# time rsync –bwlimit=1024 -v 192.168.9.50:test1G .
test1G
sent 104 bytes received 1048704102 bytes 1,019,644.24 bytes/sec
total size is 1048576000 speedup is 1.00

real 17m42.514s
user 0m15.323s
sys 0m11.405s

 

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x