WDTV 1 Forum Groups > Homebrew / Custom Firmware

wTorrent - a webserver gui for rtorrent + rtorrent settings for WDTV

<< < (3/15) > >>

Frosty_CRO:
Main reason I used rtorrent.

phatoshwest:
I am having same issue both rtorrent and transmission. WDTV freezes after I quit SSH session. I don't know why. Maybe hash checking makes WDTV too hot so my WDTV freezes.

Whatever. Frosty_CRO have you tried ntorrent? Java based GUI for rtorrent. It is still in early development but at leaset ntorrent allows user to add torrents and watch the progress.

Frosty_CRO:
Well, after EXTENSIVE testing of the rtorrent app, I've found out some very interesting results. Bear with me here, it's a long post.
And by "extensive testing", I mean sitting in front of the rtorrent telnet screen for 3 hours, noting every change as it happens, and keeping my eye out on rtorrent's memory consumption. Yeah, I am hardwired that way... :D

First of all, WDTV has only about 100 megabytes of memory, right? That's considered too little for ANY torrent app. Let's say you are downloading a movie, new Transformers, whose size is about 1.3GB. rorrent sees it being made up of around 700 chunks with the size of about 2MB. Torrent files with 4MB chunks are not uncommon. And that is BAD! Ideal chunk sizes are from 500KB to 1MB, but not every uploader espects that.

Start downloading it with rtorrent, and after 30 minutes or an hour, you see memory allocation errors, and kernel finally shuts down the rtorrent process, or it locks up the entire system. Not very uncommon on the WDTV, if you ask me. rtorent overfilled the available memory, that "overfill" seeped into the restricted kernel memory space, and it had no choice but to do an immediate shutdown, or lockup.

You are, like, WFT?! WHAT HAPPENED?! There are two possible solutions.

First one requires the creator of rtorrent to make the chunk usage option settable by the user. Something like:
max_chunk_size = xxx ( I read somewhere that the option to do so will be available soon )

Second one is a bit easier.
It requires us to modify our rtorrent.config files in suck a way, so it does not overflow the memory of the WDTV. That means, we need to tweak a couple of most important, but often overlooked and wrongly set up commands.

I will now paste my config file (6mbit/1mbit line, and explain everything in the comment line.

-------------------------------

# minimum peers you will want your rtorrent to connect for leeching, anything below 40 will do.
min_peers = 20

# maximum peers you will want your rtorrent to connect for leeching, do not
# set above this, causes memory problems.
max_peers = 40

# minimum peers you will want your rtorrent to connect for seeding, anything below 40 will do.
min_peers_seed = 20

# maximum peers you will want your rtorrent to connect for seeding, anything below 40 will do.
max_peers_seed = 40

# this is crucial!
# 3 is the golden middle, 4 is the maximum for WDTV upload slots.
# rtorrent uses about 6 to 7 megabytes of memory per upload slot!
max_uploads = 4

# memory limit for rtorrent set to 70 megabytes, so if it somehow
# reaches the limit, kernel won't hang or shut it down.
# a safety measure, really.
max_memory_usage = 75M

# someone recommended this to me. it's a rtorrent
# setting from the nslu2 linux running on a WD NAT.
# just copy them, do not modify.
send_buffer_size = 768K
receive_buffer_size = 10K

# unlimited download rate
download_rate = 0

# upload rate is crucial too! if it
# is low, then rtorrent will keep those chunks it
# does not upload in the memory, quickly
# ovefilling it and crashing your box. simple math
# is to 10 kilobytes for each max_uploads you have.
# you can se it even higher ( 60 is very good ).
upload_rate = 25

# this needs no explanation, but double check you opened
# your ports, on the router / router firewall
directory = /boot/torrents/
session = /opt/share/torrent/session
port_range = 54123-54123
port_random = no
use_udp_trackers = no

# remove these lines from your config if you're using a
# GUI like wTorrent!
schedule = watch_directory,10,10,load_start=/boot/torrents/put_torrent_here/*.torrent
schedule = untied_directory,10,10,stop_untied=
schedule = tied_directory,10,10,start_tied=

# this settings does not make rtorrent check hash on every reboot,
# but only at the end of downloading.
check_hash = no

# best hash settings available, use them.
hash_read_ahead = 8
hash_interval = 10
hash_max_tries = 5

# my ISP throttles torrent traffic, so I use this to bypass them.
encryption = allow_incoming,try_outgoing,enable_retry

# DHT is very useful, this way it sets itself if needed.
dht = auto

# ... but it needs a port for itself, open it up.
dht_port = 54124

# why not, may increase download speed.
peer_exchange = yes

# wTorrent related...
scgi_port = 127.0.0.1:5000

---------------------------------

Just remember that your WDTV, like mine, is not an all-powerful seed / leech box. It's severely underpowered, even when compared to a modern mobile phone. It was made for one purpose - playing multimedia. And that it does good.
Main problem is it's RAM size - simply too small for what we are trying to use it.
You simply cannot use ul/dl torrent settings like those recommended on various torrent sites. They are for PC use, WDTV will crash with them.

The max_memory_usage = in the rtorrent.config plays a role in this but something people are missing is the buffers.
send_buffer_size =
receive_buffer_size =

These are important, and people are setting them way too high.
FUNFACT: rtorrent accepts values in bytes but also accepts postfixing values M=Mega G=Giga

Personally on my WDTV I use:
send_buffer_size = 768K
receive_buffer_size = 10K
...and the speeds are sometimes fine.

Watch the Memory Info and see how high it gets with downloading, it should climb to a point then suddenly drop.

If it keeps climbing past 80% of the max memory value then you know your recieve buffer is too large. Make it smaller. I was having issues with a 25K buffer, 10K seems to be the sweet spot for my WDTV and will get large torrents down with no issues. No issues with speed either.

Now, if we could just enable swap ( unix-utils swapon ) memory on our WDTV, and use it with the rtorrent, that would be a whole different ballgame.
But, can it be done???

phatoshwest:
I will try your settings. Some of the entries you gave are not in my config file. I have to add them manually, am I right? I hope this will solve the randomly shutdown problem of rtorrent.

Frosty_CRO:
Add them manually. And, I think it will solve all your problems. Use this config, without wTorrent, and create / modify folders as needed:

TORRENTS NEED TIME TO BE CREATED ON YOUR DISK!!! ABOUT A MINUTE OR A BIT MORE FOR 1 GB!!! WDTV is a slow machine.

Copy the .torrent file to yourdownloadfolder/new_torrents/ and give it time! You can check out the growth of the files about to be downloaded via FTP. Just refresh.

min_peers = 20
max_peers = 40
min_peers_seed = 20
max_peers_seed = 40
max_uploads = 4
max_memory_usage = 73400320
send_buffer_size = 4096
receive_buffer_size = 4096
download_rate = 0
upload_rate = 40
directory = /yourdownloadfolder/
schedule = watch_directory,10,10,load_start= /yourdownloadfolder/new_torrents/*.torrent
schedule = untied_directory,10,10,stop_untied=
schedule = tied_directory,10,10,start_tied=
session = /yoursessionfolder/
port_range = yourport-yourport
port_random = no
check_hash = no
use_udp_trackers = no
hash_read_ahead = 8
hash_interval = 10
hash_max_tries = 5
encryption = allow_incoming,try_outgoing,enable_retry
dht = auto
dht_port = yourdhtport
peer_exchange = yes

Leave it for a couple of hours, if it still works, excellent. Then we can tune rtorrent up a notch. Do not expect impressive download speeds with this config! It's just a test.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version