본문 바로가기

Linux/기타설정

rTorrent 설정하기 (rtorrent.rc)

설치하러 바로 가기 Centos에 libTorrent and rTorrent 설치하기
자동 스크립트 CentOS 부팅시 rTorrent 자동 시작하기



들어가기 전에 이 설정은 제 기준으로 작성된 것이고 기본 사용자는 yskim입니다.
본인에 맞게끔 약간의 수정이 필요하고 제가 토런트 뉴비이다보니
잘 모르는 부분이 있을 수 있습니다. 댓글로 알려주시면 수정하겠습니다.

아래 내용은 세부 설정에 대한 설명이고 바로 저와 같이 설정 하시려면 빠른 설정하기를 클릭하세요.



우선 기본 설정파일을 받아옵니다.
(제 설정파일은 맨 밑에 올렸습니다. 그걸 받으셔서 수정하셔도 됩니다.)


이제 이 파일을 수정하면 되는데 대략적인 내용을 살펴 보겠습니다.

▼ 아래 옵션은 본인의 시스템과 인터넷 속도에 맞게 설정 하시면 되겠습니다.
제 사용 값을 적었지만 저는 대칭 광랜 사용중이니 참고만 하시기 바랍니다.

1. 우선 download_rate 와 upload_rate 는 일반적으로 무제한으로
설정하시게 되는데 그럴경우 0 값을 주시면 됩니다.
그러나 공유기 환경에서 가족들과 인터넷을 공유하신다거나 다운/업로드시
인터넷 사용이 불가할 정도로 버벅거리신다면 인터넷 속도측정후 최대치의
약 95% 값을 설정하시면 무난하게 인터넷도 같이 쓰실수 있을 겁니다.
단위는 kB/s(kilobytes/second) 입니다. kb/s(kilobits/second)에 주의하세요.
비트는 바이트를 8로 나눈값이죠. : )

2. max_peers 는 토런트당 연결 될 피어의 수를 말합니다. 해외 트래커에서 주로 활동 하신다면 
비교적 큰 값을 필요로 하지만 125정도면 충분할 것 같습니다.
상황에 따라 유동적으로 사용하는 것도 좋은 방법 이겠죠.

3. max_peers_seed 는 시딩 완료된 토런트에 대한 피어의 수로 50 으로 설정 했습니다.

4. max_uploads 는 토런트당 업로드 슬롯의 값으로 25로 설정했습니다.

# Maximum and minimum number of peers to connect to per torrent.
#min_peers = 40
max_peers = 125

# Same as above but for seeding completed torrents (-1 = same as downloading)
#min_peers_seed = 10
max_peers_seed = 50

# Maximum number of simultanious uploads per torrent.
max_uploads = 25

# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 0
upload_rate = 0

▼ 아래는 토런트 데이터가 저장될 경로를 지정해 주시면 됩니다. 본인이 원하시는 곳을 선택 하시되
절대 경로로 입력 하시기 바랍니다. 그렇지 않으면 가끔 버그가 발생할 수 있다고 하네요.
예로 ~/torrent 와 같은 경로는 피하시기 바랍니다.

# Default directory to save the downloaded torrents.
directory = /home/yskim/rtorrent/downloads/

▼ 기본 세션을 저장할 디렉토리를 지정하시면 됩니다.
이곳에 저장될 파일들의 역할은 다운로드 중인 토런트의 상태나 진행과정을 저장하였다가 시스템 재시작 또는 rtorrent 재실행 시에 저장한 파일을 검사해서 다운로드를 이어가게 됩니다. 사용자 입장에서 관여할 파일이 아니기에 숨김 폴더로 생성했습니다.

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = /home/yskim/rtorrent/.session/

▼ 다음 옵션은 특정 디렉토리에서 새로운 토런트 파일을 감시 하는 역할을 합니다.
만약 다운 받고 싶은토런트가 있을 때 이 폴더안에 .torrent  파일을 저장하게
되면 rTorrent가 자동으로 다운로드를 시작해게 됩니다. 그와 동시에 .torrent 파일은
session 폴더로 넘어가서 위에서 적은 역할을 하게 되겠죠. 시딩을 잠시 멈추시려면
watch 폴더에서 해당 파일이름을 잠시 바꾸시면 됩니다. 재시작 하시려면 다시
본래대로 돌려 놓으시면 되구요.

# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=/home/yskim/watch/*.torrent
#schedule = untied_directory,5,5,stop_untied=

▼ 아래 옵션은 디스크 공간이 부족할 때 다운로드를 중지할 스케줄을 설정하시면 됩니다.

# Close torrents when diskspace is low.
schedule = low_diskspace,5,60,close_low_diskspace=100M

▼ upload ratio에 의해 중지할 스케줄을 설정하시면 됩니다. 저는 이 설정은 사용하지 않습니다.

# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
#schedule = ratio,60,60,"stop_on_ratio=200,200M,2000"

▼ 트래커로 전달될 ip를 적어주시면 됩니다. 실제 ISP로부터 할당받은 IP를 말합니다.
저는 DynDNS에서 DDNS 서비스를 받고있는 도메인을 적었습니다.

# The ip address reported to the tracker.
#ip = 127.0.0.1
ip = ystory.mine.nu

▼ 소켓에 bind 하는 옵션입니다. 내부에서 사용하고 계신 ip를 적어주시면 됩니다.
(공유기에서 할당 받은 ip) 내부 ip는 정적으로 할당하시는 편이 좋습니다.
isp에서 고정 ip를 받아 쓰시는 분들은 위 설정과 같은 주소를 쓰시면 됩니다.

# The ip address the listening socket and outgoing connections is
# bound to.
bind = 192.168.10.100
#bind = rakshasa.no

▼ 포트 범위를 할당 하는 옵션입니다. 49152보다 높은 값으로 설정하기를 추천합니다.
고정된 포트를 사용하시고자 하면 양쪽에 같은 값을 넣어주시면 되고 또 이렇게 사용하시는 편이
올바르다고 판단됩니다. 제 개인적으로 기억하기 쉬운 포트로 설정 해봤습니다.

# Port range to use for listening.
port_range = 61700-61700

▼ 포트를 랜덤으로 선택할지 묻는 옵션입니다. 위에서 범위를 설정하셨다면
그 범위내에서 랜덤으로 선택됩니다.

# Start opening ports at a random position within the port range.
port_random = no

▼ hash check 옵션입니다. Torrent가 완료된 후 에러를 검사를 하는 옵션인데
리소스를 많이 잡아 먹기 때문에 기본적으로 사용하지 않고 있습니다.

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
check_hash = no

▼ UDP 트래커와 연결 여부를 설정하는 옵션입니다.

# Set whetever the client should try to connect to UDP trackers.
use_udp_trackers = yes

▼ 동적 ip 핸들링하는 옵션인데 저는 DDNS 를 이용하기에 주석처리 했습니다.
별도로 cron 데몬에서 해당 작업을 수행하고 있습니다.

# Alternative calls to bind and ip that should handle dynamic ip's.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa

▼ bitTorrent 프로토콜 암호화와 관련된 옵션입니다. ISP나 라우터 단에서 해당 프로토콜의 패킷을 드랍시키는 경우가 있어 일부 해외 유저들은 암호화시켜 내보내는 경우가 있습니다.
이럴 경우 아래와 같이 설정되어 있지 않으면 연결이 불가능 한 상태가 되겠죠. 물론 아래와 같이 설정하면 암호화된 패킷이 아니어도 잘 받아집니다. : )

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
encryption = allow_incoming,enable_retry

▼ DHT 활성화와 관련된 옵션입니다. 공개트래커를 주로 사용하신다면 이 옵션을 유용할수도 있겠지만
일부 비공개 트래커에서는 해당 옵션 사용시 경고를 받을 수도 있으니 주의하시기 바랍니다.

# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
#
# dht = auto

# UDP port to use for DHT.
#
# dht_port = 6881

# Enable peer exchange (for torrents not marked private)
#
# peer_exchange = yes

▼ 해쉬 검사와 관련 있는 옵션입니다. 제가 여러가지 조합으로 바꿔 보았지만 한 틱당
10MB를 넘기지 못하네요. 어찌되었든 저는 아래와 같이 사용합니다.

#
# Do not modify the following parameters unless you know what you're doing.
#

# Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
#hash_read_ahead = 12

# Interval between attempts to check the hash, in milliseconds.
#hash_interval = 5

# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
#hash_max_tries = 5

이상이 기본 설정에 대한 내용이었습니다.

최종 설정 완료된 제 파일을 올립니다. 



아래 공식 링크도 한번 살펴보시기 바랍니다.

Common Tasks in rTorrent for Dummies

추가적으로 Performance Tuning 에 대한 내용도 각자 적용해 보시기 바랍니다.

제 설정파일에는 두가지가 추가 되어 있는데

max_memory_usage = 1073741824

send_buffer_size = 65536

단위는 바이트 같습니다. 몇몇 유저들이 설정한 값을 보고 판단한 것이고 공식 자료에 설명이 없네요.

위에 max_memory_usage는 1기가 값으로 설정한 것이니

혹시라도 단위에 문제가 있을경우 각자에 맞는 설정으로 변경하시기 바랍니다.

그 외로도 Performance Tuning 관련 몇가지가 더 있으니 링크내용을 참고해 보시기 바랍니다.

끝으로 또 한가지 유용한 것은 fast resume data 인데 본인이 업로드 한 자료나 신뢰할 수 있는 파일에

적용하시면 되겠습니다.

관련 스크립트 입니다. http://libtorrent.rakshasa.no/downloads/rtorrent_fast_resume.pl

사용은 아래와 같이 하시면 됩니다.

$ rtorrent_fast_resume.pl [base-directory] < original.torrent > modified.torrent


실행중인 스샷 한장 올립니다.



설치하러 바로 가기 Centos에 libTorrent and rTorrent 설치하기
자동 스크립트 CentOS 부팅시 rTorrent 자동 시작하기


'Linux > 기타설정' 카테고리의 다른 글

ssh 서버 설정  (2) 2010.01.03
sudo 사용하기  (0) 2008.01.18