4

My upload and download speeds on my seedbox hosted on my pi constantly fluctuated between 2.5MBps and 50/0KBps. I have done file download speed tests and get upwards of 3.3Mbps, yet even on the best seeded torrents my dl/up speed soars for a couple of seconds, then abruptly grinds to a halt for another few.

So far I have found this thread, which describes my problem accurately, but it doesn't come to a decisive answer.

I have already tried changing all the settings in Deluge, and even used transmission on my pi to no avail. I've checked the CPU and memory usage so it can't be that, maybe the power supply??

I am downloading to an external USB flash drive so that could be the issue, if so how could I check the read and write speeds?

I have also torrented on my computer on my home network so I doubt it could be my ISP throttling p2p connections.

Does anybody know why this could be, or have resolved a similar issue when torrenting with a raspberry pi?

EDIT 1:

Just added some more really well seeded torrents and observed the download speed. Even with 173 seeders and 0 peers still maxed out around 1MBps then fell to around 50KBps. Could it be that my router is sending too many packets for my pi to handle?

EDIT 2:

After changing to transmission and tweaking the settings a little I found this problem to go away. I think the deluge in the raspi-repo is outdated, and I would recommend anyone who is having the similar problems to do the same.

Carlo Revelli
  • 123
  • 1
  • 8
  • Have you experimented with capping your download rate? I'd start with something low (1-200 kbps) and evaluate its behaviour at that. If you experience the same issue then you can rule out everything related to your connection speed. – goobering Apr 28 '16 at 14:11
  • Nope just maxes out around 200 kbps and then repeats. – Carlo Revelli Apr 28 '16 at 14:13
  • Have you checked the log for anything interesting? – goobering Apr 28 '16 at 14:31
  • I'm wondering if it's something to do with the device's disk buffer or OS cache. If you write to a different (preferably faster) device does this still happen? – Jacobm001 Apr 28 '16 at 17:41
  • Will update when I change my flash drive for a HDD this weekend. I downloaded a test file to the mounted device and got 2.5MBs speeds.
                       ```100MB.zip                     100%    [==================================================>]     100.00M  2.40MB/s   in 56s```
    
    – Carlo Revelli Apr 28 '16 at 19:06
  • @CarloRevelli I have the same problem. How did you tweak the Transmission settings in Edit 2. Share please – kiltek Jul 27 '17 at 11:46

2 Answers2

3

Their are many possible problems that could lead to a slow download speed.

  1. It could be because of the limited number of connections you can make, often the other people you are downloading from will have very limited upload speed, and a decent upload speed is only created with a lot of connections, sadly the Pi is not capable of handling a lot of connections so sometimes you will get lucky and connect with someone who has a higher upload speed than usual who will allow the Pi to download faster without the need for more connections to be opened. Note: I personally find that limiting connections to something like 20-50 and bandwidth to something like 1mbps prevents connections from timing out and also prevents Ethernet from challenging the USB ports for bandwidth.
  2. It may also be due to the fact that most torrent clients download to ram then flush when it's full which may be the slowdown that you are noticing on the Pi. Furthermore when said cache in memory is flushed it must be flushed to the usb drive which you are using, which just so happens to share the same bus as the ethernet port as the Pi does not have a native Ethernet port but instead a usb hub with Ethernet adapter built in. Furthermore torrenting has always been rather slow on the Pi due to the nature of torrenting requiring the Pi to use a checksum included in the torrent file to ensure that you aren't being sent the wrong chunk from someone.
  3. You may also be using encrypted torrenting which although prevents man in the middle attacks also has an incredibly detrimental effect on download and upload speeds as a lot more steps are added to the torrenting process such as, key negotiation, the location of a suitable client (one that also wishes to use encryption) and then all packets must then be decrypted at a snails pace.
  4. Finally if you are using a Pi with less than a gigabyte of ram I strongly recommend you upgrade as the difference will be noticing everyone as more ram will eleviate some of the need for writing to your sub thus freeing up the usb bus for the Ethernet port.
  5. Note: If you are on transmission be sure that you set your preferred download speed on the bottom left and be sure that the turtle has not been selected as selecting the turtle will lead to a default download speed of 50kbps which is what you are describing.
Mohammad Ali
  • 2,383
  • 1
  • 11
  • 18
-2

Don't listen to Ali. You clearly have a disk problem. Either "full" disk or problems to write to disk. I suspect your USB drive is to blame and you need a new one. Your write speed is slowing down because only smaller and smaller files find enough write space on the (full) disk. Thus the diminishing returns and speed.

SamTzu
  • 1
  • 2
  • I just "fixed" this exact problem by adding more storage space when it started to run out. – SamTzu Aug 23 '21 at 17:15
  • 1
    The user clearly didn't have a full disk, as they state "After changing to transmission and tweaking the settings a little I found this problem to go away." – Greenonline Aug 23 '21 at 17:26
  • There is this setting called "Cache Size" in Deluge. Look it up. Anyway the problem does not have to be in size but in ability to write to disk. – SamTzu Aug 23 '21 at 17:30
  • 1
    Do you know how a file-system works? Your write speed is slowing down because only smaller and smaller files find enough write space on the (full) disk.. That is just wrong, a inode has basic file info and a list of "data blocks" where the file content is stored. And then to change to "Cache Size" is not going to make your answer more valid. – MatsK Aug 23 '21 at 19:37
  • 2
    The cache size on any filing system has nothing to do with the size of a file finding space on a disk. This answer is wrong in almost every respect. – Chenmunka Aug 23 '21 at 20:31