2011年4月18日 星期一

rtorrent停頓的問題[已解決]

最近 Squeeze 的 rtorrent 不知道是不是瘋掉了,一直會有停頓的現象產生,一直找不出原因,一度跳槽到 transmission-daemon,但因為不支援 DHT port setting以及傳輸不快,所以就硬著頭皮找出 rtorrent 停頓的問題。


原本的設定參數如下:
# Maximum and minimum number of peers to connect to per torrent.
min_peers = 50
max_peers = 100

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

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

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

# Default directory to save the downloaded torrents.
directory = /mnt/disks/bt/rtorrent/temp

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

# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=/mnt/disks/bt/rtorrent/watch/*.torrent
schedule = untied_directory,5,5,"remove_untied="

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

# 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"

# Port range to use for listening.
port_range = 6886-6889

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

dht = auto

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

send_buffer_size = 8M
receive_buffer_size = 2M
encoding_list = utf-8

# move to /mnt/disks/bt/rtorrent/finish when completed.
system.method.set_key = event.download.finished,move_complete,"execute=mv,-u,$d.get_base_path=,/mnt/disks/bt/rtorrent/finish;d.set_directory=/mnt/disks/bt/rtorrent/finish"

max_open_files = 2048

# 512MB ram size
max_memory_usage = 512M

#scgi_port = 127.0.0.1:5001

不管是 rtorrent-0.8.6/rtorrent-0.8.7版本,啟動 rtorrent 時,速度會衝很快,但是到達某個程度時,會突然頓住,完全無反應,過了很久後,速度變回個位數,然後又往上爬,直到達某個程度時,會突然頓住,完全無反應,過了很久後,速度變回個位數…(這樣持續不斷的無窮迴圈)

不斷地嘗試錯誤,終於找到關鍵的設定,只要將下面的設定改成:
min_peers = 1

沒錯,就是這一行,官方的 rtorrent.rc 是設定 50,而我也是套用官方設定沒改,所以才出現這個怪現象。重開 rtorrent 後,速度就會一直往上衝,而且不會停頓,即使同時下載20個torrent檔,鍵盤反應也不會停頓(Atom 230+1G ram),已經測試了7hr,完全沒有突然頓住的現象,似乎就能解決這個怪異的問題了。

以上是小弟自已嘗試錯誤找到的,不一定正確,希望對有同樣問題的人有所幫助。

4 則留言:

阿信 提到...

最後我再把底下這一行註解,就沒出現過速度變慢的問題了。

# move to /mnt/disks/bt/rtorrent/finish when completed.
system.method.set_key = event.download.finished,move_complete,"execute=mv,-u,$d.get_base_path=,/mnt/disks/bt/rtorrent/finish;d.set_directory=/mnt/disks/bt/rtorrent/finish"

linuxfce 提到...

請問一下,因為rtorrent常常crash,是否有方法可以讓rtorrent在一個screen的session自動重開呢

謝謝

阿信 提到...

rtorrent常常crash的事情我也沒找到,我自已的做法是:

while true
do
rtorrent
done

只要 rtorrent crash,會自動重跑 rtorrent...很白痴但直接的方法

阿信 提到...

現在過了一年後,改用 rtorrent-0.8.9 之後,上述的event.download.finished已經可以正常使用了。