i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Other platforms, generic questions.
menash

i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by menash »

i have tplink 1043ND router with openwrt on him, which connected to centurylink c1000a modem.
the 1043ND make the connection to the internet.
i have 2 linux OSes (Arch, gentoo), and in both of them(dualboot) the problem exist.
my connection's speed is 60 mbps download and 3 mbps upload.

in the last 4 days, i have a torrent that is **only seeding**.
in all this time the connection was lost many many times.
sometimes twice or thrice, in a hour.
i think the blame is for qbittorrent because when i shut it down, my internet connection keeps alive, like the last 16 hours when qbittorrent is closed and the connection wasn't lost.
also i remember i had a connection for couple of days not long time ago.
when i start seeding it starts disconnecting, and it keeps doing that(disconnect my connection) all the time the torrent is working.

i tried to lower the upload speed limit to 200 KBps but it doesnt help(keeps disconnecting).
i tried to disable half open connections but the problem still exist.

DHT, peer exchange and local peer discovery, are all enabled in qbittorrent.
also, global max connections is set to 250, max connections per torrent is set to 100, global maximum upload slots is set to 8, and maximum upload slots per torrent is set to 4.

i do not have slow browsing experience when i seeding.
the browsing keeps working good(till the disconnect of course).
the problem is just that the internet connection is lost completely all the time the torrent is seeding.

please help :-).
ciaobaby

Re: i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by ciaobaby »

Reduce the connection limits and the half-open connections (options -> Advanced).

set half-open at 5 - 10 lower is better to start off with.


Start off with connections per torrent at 15 and test. If it does not drop out go up to 20 and test again. Repeat until you get to a point where it does start dropping out, then turn it back 5. this is the point that your router can safely handle.

Then set global maximum to;

CGM = CPT x (MAT/1.5)

Where:
CGM = Connections Global Maximum
CPT = Connections per torrent
MAT = Maximum Active Torrents you expect to run

If it stays stable at that you can always tweak the ratio (MAT/1.5) down a bit further. Now you can turn up the half-open value but do not go over the 10 -15 mark by very much.
Switeck

Re: i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by Switeck »

As ciaobaby said, lowering half open connections should help. If your qBitTorrent is not firewalled, qBitTorrent could even run ok with half open connection max set to 1.

In the past, DHT (which uses UDP packets) was "hard" on weak routers...so you could test with that disabled.
uTP (which also uses UDP packets) may cause a problem too, but that's not as likely as DHT.
LPD (uses multicast/broadcast packets) could be triggering bugs in the router which causes disconnections.

If you did manual port forwarding of the router, UPnP and NAT-PMP should be unnecessary and may even conflict with the manually forwarded port.

If the router has stateful packet inspection (SPI) which is sometimes called a hardware firewall, that tends to put a heavy load on the router for almost no protection whatsoever. Better to have a software firewall on your computer.
Last edited by Switeck on Thu Nov 19, 2015 7:25 am, edited 1 time in total.
menash

Re: i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by menash »

thank you both for your answer :-).
as i said in my first message: i disabled *completely* half open connections and i still disconnected from the internet.
also i checked it further and the problem is also in windows(same version of qbittorrent: 3.2.5).

and finally i checked also utorrent(3.4.6) on windows(same computer(i also have windows. yes :-))) with default settings and everything is working great.
i did not disconnect from the internet at all, in the couple of hours i checked it.

is it just me?
no body else experience the same problem when seeding in qbittorrent with latest version?
Switeck

Re: i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by Switeck »

[quote="menash"]as i said in my first message: i disabled *completely* half open connections and i still disconnected from the internet.[/quote]There is some confusion on my part what a value of 0 means for Maximum number of  half-open connection means. It may stop qBitTorrent from making any half-open connections. (By some definitions udp trackers and uTP peer/seed connections don't use that, so they could still function. And pre-started torrents could still get incoming connections.) However it's my guess that [0: Disabled] means disable the maximum limiter and just run "wide open".

Please test qBitTorrent with DHT disabled in qBitTorrent. If that causes a problem but uTorrent can run with DHT enabled without apparent problems...it would be helpful to know!
menash

Re: i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by menash »

thanks again :-).
i lowered my half open connections to 5 max.
the problem now is that the specific torrent i used to upload(i started it) for a couple of days, doesn't need me anymore.
there are more seeds that do the job so now i do not upload at all :(
do you know a popular torrent that doesn't have many seeds (but many peers want it) ?

EDIT:
i have open port for qbittorrent  :-)
Last edited by menash on Thu Nov 19, 2015 2:03 pm, edited 1 time in total.
ciaobaby

Re: i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by ciaobaby »

From the libtorrent manual
half_open_limit sets the maximum number of half-open connections libtorrent will have when connecting to peers. A half-open connection is one where connect() has been called, but the connection still hasn't been established (nor failed). Windows XP Service Pack 2 sets a default, system wide, limit of the number of half-open connections to 10. So, this limit can be used to work nicer together with other network applications on that system. The default is to have no limit, and passing -1 as the limit, means to have no limit. When limiting the number of simultaneous connection attempts, peers will be put in a queue waiting for their turn to get connected.
Any Linux distro such as Centos, Mint, Ubuntu, Kali, Caine, Mageia, Slackware will usually have peers to upload to
menash

Re: i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by menash »

so i tried to seed again the same torrent and it again start to upload in full speed as before.
as i said before, i lowered the max half open connections to 5.
it worked great for 3 hours, so i thought it was fixed(usually i disconnected from the internet after 10 to 40 minutes since connection was established)
so after those 3 hours i wanted to try to add couple of torrents(linux OSes from the list ciaobaby gave me in his answer(thanks mate :-))) to qbittorrent.
i added Kali, mageia and debian, and then, after the last torrent was added (do not remember which) to qbittorrent, i got disconnected from the internet.
maybe the number 5 is too low?
any suggestions?

anyway i changed the number of max half open connections  to 10 and will check again for couple of hours to see if the connection keeps alive and then i'll try to add again those 3 torrents and see if then the connection will not lost.
menash

Re: i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by menash »

well i didn't wait couple of hours as i said, and after couple of minutes after the connection was renewed and the torrent was seeding normaly, i added 6 linux OSes to qbittorrent and then the connection was lost immediately.
Switeck

Re: i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by Switeck »

The sheer number of incoming connections may be what's causing the disconnects. This cannot be limited by a low half open connection max limit in qBT.

Is DHT and uTP still enabled in qBT?
ciaobaby

Re: i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by ciaobaby »

maybe the number 5 is too low?
No, router drop-outs are usually caused by too many connections overloading the network stack and things like the DNS cache being overloaded.

You probably should think about bypassing your router's DNS caching server, as running a BT client is very heavy on DNS queries and ISP provided routers are not especially robust.
menash

Re: i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by menash »

Switeck wrote: The sheer number of incoming connections may be what's causing the disconnects. This cannot be limited by a low half open connection max limit in qBT.

Is DHT and uTP still enabled in qBT?
yes, they are both enabled(default settings).
ciaobaby wrote:
maybe the number 5 is too low?
No, router drop-outs are usually caused by too many connections overloading the network stack and things like the DNS cache being overloaded.

You probably should think about bypassing your router's DNS caching server, as running a BT client is very heavy on DNS queries and ISP provided routers are not especially robust.
i am now trying what you suggested before, and playing with both half open connections and connections per torrent, numbers.
Switeck

Re: i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by Switeck »

[quote="menash"][quote="Switeck"]Is DHT and uTP still enabled in qBT?[/quote]yes, they are both enabled(default settings).[/quote]Please test qBitTorrent with DHT disabled.
menash

Re: i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by menash »

[quote="Switeck"]
[quote="menash"][quote="Switeck"]Is DHT and uTP still enabled in qBT?[/quote]yes, they are both enabled(default settings).[/quote]Please test qBitTorrent with DHT disabled.
[/quote]

i want before that to try to lower the per torrent connections, and check it for couple of hours.
i did it from up to down and not as ciaobaby suggested.
i started from 50 connection per torrent, then down to 45 and 42 and even 35, and the connection was lost every time when i added many torrents(8 linux torrent) one after the other.
sometimes not immediately but after couple of minutes.
now i'm on 20 connections per torrent and 5 max half open coonections.
the connection didn't lost but its just 40 minutes of checking so i'll wait more.

also i'll not be here in the next 24 hours so my update will postpone for a while but i'll come back :-).

thank you!
menash

Re: i think qBittorrent disconnect my internet connection(i use version 3.2.5)

Post by menash »

well nothing is wotking for me.
i got to 5 max half open connection and only 20 connections per torrent and the router still disconnect after i add 8 linux torrents one after the other.
i also disable cache(i think) of dns in my router.
i have openwrt on my router, so i tried to add to the settings of the dnsmasq:
cachelocal '0'  which in the openwrt-wiki it says: "When set to 0, use each network interface's dns address in the local /etc/resolv.conf. Normally, only the loopback address is used, and all queries go through dnsmasq."

i also added there(in the dnsmasq settings):
cachsize '0' which disabled the cache.

still i continue disconnecting when i add more torrents(8 in my case).

to conclude:
the first problem (when i had just 1 torrent in qbittorrent and it was just seeding) was sloved(i think), after i lowered the max half open connectins to 5.
then i tried to add couple of torrents to the list and start disconnecting again, so the problem still exist.
the cause is (maybe) different.

"Please test qBitTorrent with DHT disabled."

Ok but please tell me how many half open connections and per torrent connections, to use.
Post Reply