Page 1 of 1

Need help with bitorrent speed issues

Posted: Tue Apr 28, 2015 3:11 am
by cacophony555
I'm trying to setup Deluge on my Raspberry Pi 2 using the following tutorial:
http://www.howtogeek.com/142044/how-to- ... rrent-box/

All the steps work fine, but when I actually add a torrent I see a wildly variable download speed that also appears cyclical. When I initially start it will quickly ramp up to ~8MB/s, then quickly drop to zero, then goes back up to~1MB/s, then back to zero for awhile:

0-10 seconds: linear increase from 0MB/s to 8MB/s
10-20 seconds: linear decrease from 8MB/s to 0MB/s
20-60 seconds: constant 0 MB/s (though all peers still show as connected)
60-70 seconds: jumps back to ~1MB/s
70- seconds: constant 0MB/s

It occurs on both the thin-client and direct webui version. I I figured it might just be an issue with Deluge so I tried qbitorrent and experienced the same issue. I tried port forwarding on my router to make myself connectable, but that didn't help. I tried reducing the max number of connections, speed, etc, but that didn't help.

I ran "top" while this cycle was happening and never saw cpu go above ~10% at the point when downloading was at 0MB/s. I did see it jump as high as 150% while downloading at the 8MB/s rate, but this max CPU went down to about 50% after I dropped the max number of connections, etc.

This is using a known well seeded torrent (http://www.linuxmint.com/edition.php?id=172), which downloads at a very stable and consistent rate on my Windows 7 laptop via Deluge.

If I do a network speed test on my Pi I get a very stable 10MB/s download rate:
curl -o /dev/null http://speedtest.wdc01.softlayer.com/do ... est500.zip

I tried a brand new 2/16 raspian image, both with and without the initial "sudo apt-get update"," sudo apt-get upgrade" steps. I also tried the microsd card in a different Pi 2 but it didn't help.

Any ideas what I can do here? I'm totally out of ideas at this point.

Re: Need help with bitorrent speed issues

Posted: Tue Apr 28, 2015 10:14 pm
by vanv101
I noticed the same thing when running various bittorrent software on my Pi 2. Ended up settling with qBittorrent headless and throttling my speeds under settings. I think it's a SD card issue. My internet speed is 300Mb/20Mb so that's not a factor.

My average download using the same command you used is: 2667k , so it's kind of bad. On my MBP13 I get ~22MB/sec on 802.11AC.

Re: Need help with bitorrent speed issues

Posted: Wed Apr 29, 2015 3:55 am
by cacophony555
Interesting, thanks for the reply. I wonder if using an external hard drive would help.

Re: Need help with bitorrent speed issues

Posted: Wed Apr 29, 2015 6:23 am
by vanv101
I would think some type of SSD would work better but from what I've been reading you're still limited in the I/O category on the Pi. I'm using a Kingston Class 10 16GB microSD card, which works great, but if I could get better results from a better quality chip. I would take that into consideration before you spend more on a separate HD. There's got to be a way to configure torrent software better to optimize for the type of hardware we are using.

Re: Need help with bitorrent speed issues

Posted: Wed Apr 29, 2015 1:55 pm
by Amarand
vanv101 wrote:I would think some type of SSD would work better but from what I've been reading you're still limited in the I/O category on the Pi. I'm using a Kingston Class 10 16GB microSD card, which works great, but if I could get better results from a better quality chip. I would take that into consideration before you spend more on a separate HD. There's got to be a way to configure torrent software better to optimize for the type of hardware we are using.
I'm liking the sound of the card...Class 10 and 16GB with the Kingston brand sounds like a winner. So that makes me wonder: with the latest RPi, current software, Raspbian O/S, completely updated, what's the largest, fastest, reasonably-priced microSD card I can put into this thing? Is 16GB the higher-end limit? Is there a discussion somewhere else that talks about the limitations of size and speed? I'm tempted to pick up that exact card above, but worried that there might be a 32 or 64 that would work better, yet give more space. Thoughts?

Re: Need help with bitorrent speed issues

Posted: Wed Apr 29, 2015 4:57 pm
by cacophony555
FWIW, I'm using a "SanDisk Ultra 32GB UHS-I/Class 10 Micro SDHC Memory Card Up to 48MB/s". I did a disk read/write test at some point and didn't see anywhere near 48MB/s. I can't recall the exact numbers, though I remember it as being around 10MB/s, and that might just be sequential reads.

Perhaps writing is less of a bottleneck if it's being done to something separate than the microsd with installed OS. Maybe more parallelization is possible between OS reads/writes and the USB storage ready/writes? The USB 2.0 will likely max out around 30 MB/s, but that could be much higher than what we're seeing with the microsd.

Re: Need help with bitorrent speed issues

Posted: Wed Apr 29, 2015 5:30 pm
by Amarand
cacophony555 wrote:FWIW, I'm using a "SanDisk Ultra 32GB UHS-I/Class 10 Micro SDHC Memory Card Up to 48MB/s".
Good to hear I'll get at least reasonable speeds out of this card line, as I picked up the "SanDisk Ultra 64GB UHS-I/Class 10 Micro SDXC Memory Card Up to 48MB/s With Adapter- SDSDQUAN-064G-G4A [Newest Version]" which is cool because that specific part number is listed as green/ok "2015-02-16-wheezy-raspbian works well" in the database. Hooray!

http://elinux.org/RPi_SD_cards

Re: Need help with bitorrent speed issues

Posted: Wed Apr 29, 2015 5:32 pm
by vanv101
I wouldn't get anything slower than a class 10 card. You can get SD cards for super cheap, the best value for me was the 16GB card. If I didn't need the bundled full size SD card adapter I would have bought the 32GB SanDisk. I would also look into microSD --> eMMC adapters.

Re: Need help with bitorrent speed issues

Posted: Wed Apr 29, 2015 5:44 pm
by Amarand
vanv101 wrote:I wouldn't get anything slower than a class 10 card.
Agreed. I may decide to eventually use this in a GoPro or something, and I'm a fan of the class 10.
vanv101 wrote:You can get SD cards for super cheap, the best value for me was the 16GB card. If I didn't need the bundled full size SD card adapter I would have bought the 32GB SanDisk.
Oh, for sure, super cheap if you shop around! Amazon has the 64GB with adapter for $31.75, which I think is decent:

http://www.amazon.com/gp/product/B00M55C1I2
vanv101 wrote:I would also look into microSD --> eMMC adapters.
I started Googling, and was a little confused. What would I use one of those for?

Re: Need help with bitorrent speed issues

Posted: Wed Apr 29, 2015 10:05 pm
by RobHenry
I think you're mistaken to pursue sd card speed as the reason for super slow torrent download speeds. High speed sd cards are designed for long bursts of write operations to support hd video recording whereas an operating system performs many small i/o operations which, ironically, are often supported better by class 6 cards. There's plenty of discussion on the topic in old threads on the forum.

I get consistent torrent download speeds averaging around 2MB/s using transmission. I've never used deluge so don't know if it's any good or not but you (cacophony555) might want to consider trying transmission if you're still having problems.

Re: Need help with bitorrent speed issues

Posted: Thu Apr 30, 2015 1:34 am
by cacophony555
RobHenry wrote:I think you're mistaken to pursue sd card speed as the reason for super slow torrent download speeds. High speed sd cards are designed for long bursts of write operations to support hd video recording whereas an operating system performs many small i/o operations which, ironically, are often supported better by class 6 cards. There's plenty of discussion on the topic in old threads on the forum.

I get consistent torrent download speeds averaging around 2MB/s using transmission. I've never used deluge so don't know if it's any good or not but you (cacophony555) might want to consider trying transmission if you're still having problems.
I've used transmission successfully in the past with my original raspberry pi, but for my new setup I want to take advantage of a SOCKS5 proxy, which unfortunately transmission doesn't support.

Re: Need help with bitorrent speed issues

Posted: Thu Apr 30, 2015 10:46 pm
by vanv101
The problem with me is that 2MB is way below what my ISP provides. If I let it go without throttling then it ramps up, freezes, then the download starts again. If only done a little research into the cause so that's why I was thinking about faster SD cards. The only way I'd go the external hd route is if I setup a NAS, probably from Synology.

Re: Need help with bitorrent speed issues

Posted: Tue May 05, 2015 6:23 am
by cacophony555
Update:

So I bought a WD Elements 500GB portable hard drive and formatted it to be EXT4 using this tutorial:
http://devtidbits.com/2013/03/21/using- ... pberry-pi/

Now I get a consistent 9.5MB/sec write within Deluge, which is basically maxing out my internet connection :D
What a difference! And this is even routed through an anonymous proxy server in another country.

I have the drive connected directly to a USB port in my pi, which did require these to be added to /boot/config.txt for the drive to be recognized:
max_usb_current=1
safe_mode_gpio=4

Hope this helps someone.

Re: Need help with bitorrent speed issues

Posted: Tue May 05, 2015 8:34 am
by amigaholic
I'd always recommend using a powered USB hub to run a hard disk off, rather than run it directly from the Pi's own USB power.

Or, use an external hard disk that comes with its own power supply unit (i.e. WD MyBook series).

I know the new ARMv7-powered Pi2 seems to handle powered USB disks better than the ARMv6-powered Pi did, but I'd still rather not take the chance of losing data.

Re: Need help with bitorrent speed issues

Posted: Tue May 05, 2015 9:03 am
by DougieLawson
amigaholic wrote:I'd always recommend using a powered USB hub to run a hard disk off, rather than run it directly from the Pi's own USB power.
BZZZT! Wrong!

The

Code: Select all

max_usb_current=1
option is there to allow the B+ or 2B to run a HDD without a hub. It works well with my SATA driver in a USB powered carrier.

Re: Need help with bitorrent speed issues

Posted: Tue May 05, 2015 12:12 pm
by amigaholic
Seems harsh to say I'm wrong. Not everyone's setup is the same as your own.

What other USB devices do you have powered directly from your Pi? What happens to the hard disk's power supply if you connect something else to the integrated USB ports that requires a fair chunk of power too? What if the Pi itself locks up/reboots during a hard disk write? Data loss isn't guaranteed in that scenario but the risk of it is elevated.

A decent powered USB hub for the hard drive would offer a layer of isolation to input power shortages that the Pi2 might not have built in to it. I'm not an electronics specialist, and have no particular knowledge of what happens to a Pi or Pi2 if the power supply suddenly can't cope with the Pi, a hard disk, a mouse and keyboard, or X/Y/Z component too. Does it refuse to power the new device? Does it attempt to, and then fail to provide power to one or more existing connected devices? Does the Pi itself stop working? I don't know.

By all means, use a hard disk connected directly to and powered by your Pi2 - if it works for you, great, but what I said was "I'd always recommend using a powered USB hub", not "It'll all go horribly wrong if you do"

Re: Need help with bitorrent speed issues

Posted: Tue May 05, 2015 12:29 pm
by DougieLawson
I've had no problems connecting four devices, no HUB to my 2B and B+ systems which are running from a 2A supply. In a worst case the brownout detection will kick in.

Re: Need help with bitorrent speed issues

Posted: Tue May 05, 2015 12:41 pm
by Massi
DougieLawson wrote:The

Code: Select all

max_usb_current=1
option is there to allow the B+ or 2B to run a HDD without a hub. It works well with my SATA driver in a USB powered carrier.
Yesterday evening i tried to put the magic string in my Pi 1 B (not plus) and could not get it to explode. But i don't think the max current option is working in any way, since that when i connect an external HDD the raspi reboots :)
So for old B models is this really useless?

Re: Need help with bitorrent speed issues

Posted: Tue May 05, 2015 12:57 pm
by RaTTuS
Massi wrote:
DougieLawson wrote:The

Code: Select all

max_usb_current=1
option is there to allow the B+ or 2B to run a HDD without a hub. It works well with my SATA driver in a USB powered carrier.
Yesterday evening i tried to put the magic string in my Pi 1 B (not plus) and could not get it to explode. But i don't think the max current option is working in any way, since that when i connect an external HDD the raspi reboots :)
So for old B models is this really useless?
yes this is only useful for B+ or B2 [a+ also but less useful]