[Solved for Reals] Slow Speeds on Ubuntu LXC qBittorrent-nox

Linux specific questions, problems.
Post Reply
thenewguy

[Solved for Reals] Slow Speeds on Ubuntu LXC qBittorrent-nox

Post by thenewguy »

Issue:
Slow speeds (goes down to bytes per second) on a torrent server I just set up using qbittorrent-nox installed on an Ubuntu LXC on Proxmox. The LXC has 2 cores and 2 GB of RAM. It's headless.

My Set Up
  • pfSense running on an R210 II
  • Proxmox running on an PowerEdge R720XD. Ubuntu LXC running on that, with qbittorrent-nox installed.
  • OpenVPN Client on the pfSense firewall connected to PIA VPN. Both Ubuntu LXC and my Linux MInt Desktop computer are grouped into this VPN connection using an alias.
Speed Tests
Imgur album with speeds.
  • First image shows speed test from my desktop computer using the same VPN connection
  • Second image shows same test but using fast.com
  • Third image shows qBittorrent on my desktop computer downloading a torrent at 3.5 megabytes per second. Limited only because I capped it at 3.5 MB/s in qBittorrent itself.
  • Fourth image shows qbittorrent on the Ubuntu LXC. When starting the same torrent it goes up to maybe 130 kilobytes per second then slowly goes down to what you see in the image
  • NOTE: these tests were not done concurrently, instead done one after the other
Software Versions
Ubuntu LXC:
  • Ubuntu 20.10 with most recent update:

    Code: Select all

    apt update && apt upgrade
  • qbittorrent-nox v4.2.5
  • libtorrent version 1.2.5.0
qBittorrent Settings Information
Enabled protocol: TCP and uTP
Global maximum # of connections: 500
Maximum # of connections per torrent: 100
Global maximum upload slots: (unchecked, not limited)
Upload slots per torrent: (unchecked, not limited)
Apply rate limit to uTP protocol: checked
Apply rate limit to transport overhead: checked
Apply rate limit to peers on LAN: checked
Encryption mode: allow encryption
IPv6 on or off? not sure how to check this on the qbittorrent-nox webgui? IPv6 is turned off on the firewall as well as VPN.
libtorrent version: 1.2.5.0
Connection status: green plug, means connected?
DHT node count: 284 nodes
VPN: yes, PIA VPN

What type of profile user I am
Do you seed more than download? or vice versa?: I am trying to transition to downloading a lot to seeding more
How many tasks do you expect to run on average?: I am trying to seed a lot, which is why I allocated processors/memory to the LXC
Do you use the machine for other tasks simultaneous with BitTorrent downloads? no, this is a dedicated seed box
Are there other users on the LAN? yes, but probably not an issue since qbittorrent on my desktop computer doesn't have any issues

More Notes
  • running htop while trying to torrent on the Ubuntu LXC shows CPU and RAM usage are low (i.e., not a resource issue)
  • iperf3 from Ubuntu LXC to pfsense firewall shows 945 Mbps. (not an issue with NICs)
Other thoughts
I definitely do not think the issue is with my set up or the VPN. I can torrent using qbittorrent on my Linux Mint Desktop computer and it goes up to 3.5 MB/s. I've been downloading using this set up for years, and have soemtimes even reached 12 MB/s. I just recently set up this proxmox box and the Ubuntu LXC for qbittorrent-nox. I suspect the issue is with the Ubuntu LXC or qbittorrent-nox itself.

Thank You
Any help with this issue would be really appreciated. I have been using qBittorrent on my desktop computer for years and prefer it to everything else. I love that it's written in C++ and uses the Qt framework. :)
Last edited by thenewguy on Wed Mar 31, 2021 9:48 am, edited 2 times in total.
thenewguy

Re: Slow Speeds on Ubuntu LXC qBittorrent-nox

Post by thenewguy »

I posted my info based off of this guide from the wiki. If more info is needed I can provide.
thenewguy

Re: Slow Speeds on Ubuntu LXC qBittorrent-nox

Post by thenewguy »

I switched to a Centos 8 LXC with qBittorrent-nox installed. I downloaded a test torrent and it's getting 7.5 MB/s with VPN and 21.1 MB/s with no VPN. I think the previous problem I was experiencing was something to do with Ubuntu LXC and qBittorrent-nox. I'll stick with Centos 8 for this torrent box. :)
User avatar
Peter
Administrator
Administrator
Posts: 2690
Joined: Wed Jul 07, 2010 6:14 pm

Re: [Solved] Slow Speeds on Ubuntu LXC qBittorrent-nox

Post by Peter »

I'm glad you found a "solution".
On Ubuntu , I'd recommend using LXD. There is also Proxmos's own PVE (which is a layer on top of LXC, kinda like how LXD is a layer on top of LXC). And there is "systemd-nspawn". There is a bunch basically. I myself have been using LXD for years now, I'm a happy camper, but I always fear Canonical might just throw it out one day.

That said, Proxmox has been plagued with bugs lately for me. Can't stop VM, broken updates, can't force VMs, etc. So I guess the whole landscape is just "rough".
thenewguy

Re: [Solved] Slow Speeds on Ubuntu LXC qBittorrent-nox

Post by thenewguy »

Peter wrote: Wed Mar 31, 2021 7:33 am I'm glad you found a "solution".
On Ubuntu , I'd recommend using LXD. There is also Proxmos's own PVE (which is a layer on top of LXC, kinda like how LXD is a layer on top of LXC). And there is "systemd-nspawn". There is a bunch basically. I myself have been using LXD for years now, I'm a happy camper, but I always fear Canonical might just throw it out one day.

That said, Proxmox has been plagued with bugs lately for me. Can't stop VM, broken updates, can't force VMs, etc. So I guess the whole landscape is just "rough".
My original problem came back, unfortunately. But I've actually fixed it now. I just spent the past...I don't know how many hours...troubleshooting the problem. I noticed it only came back after I changed the download location from the default location to the mount point. That was the clue that told me qbittorrent didn't have permissions to use the download location I was setting it to. So I figure when some sort of cache in qBittorrent filled up it just stopped downloading because it couldn't flush out that cache to the download location. Basically a permissions issue.

The Fix:
This is how I now have things structured:
TrueNAS --> (cifs share) --> Proxmox --> (mount point) --> torrent server on LXC

The real reason it was broken was because the LXC was an unprivileged container. Meaning UIDs/GIDs on the container get mapped to 100000+ on the host. The Linux Container does this for security reasons.

So to fix it I created a "torrentuser" on the host (proxmox), and changed the UID:

Code: Select all

useradd torrentuser

Code: Select all

usermod -u 101000 torrentuser

Code: Select all

groupmod -g 101000 torrentuser
Now with "torrentuser" having a UID of 101000, I connected it to the samba share on the host like this in /etc/fstab:

Code: Select all

//192.168.1.XXX/torrent /mnt/torrent cifs credentials=/etc/creds/.creds.key,uid=101000,iocharset=utf8,vers=3.0
It was easier to create a new user on Proxmox rather than go through the whole mapping nonsense, and obviously mapping root on LXC to root on host would defeat the purpose of the container being unprivileged.

Anyways...sorry for rambling. I'm really excited it's actually working this time. I'm happy I don't have to have my desktop computer on all the time downloading things. :)

I'm thinking of doing a write up somewhere detailing exactly what I did. Maybe over on r/Homelab or something.
Last edited by thenewguy on Wed Mar 31, 2021 9:55 am, edited 3 times in total.
thenewguy

Re: [Solved] Slow Speeds on Ubuntu LXC qBittorrent-nox

Post by thenewguy »

Good links if anybody stumbles onto this from Google:
Post Reply