This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KTorrent starts and stops, killing my net connection

Tags: None
(comma "," separated)
Kalessin
Registered Member
Posts
78
Karma
0
I could have sworn that I read about this in another post somewhere, but I can't find it now, so I'll mention it anyway (sorry if it's a repeat). This problem is with the 2007-04-14 snapshot and I'm pretty sure that it wasn't a problem with the snapshot I was running previously (I'm not sure which, but it would probably have been one of the March ones).

Periodically KTorrent ceases to download or upload anything. It stalls completely. While it is stalled, my net connection is basically dead. _Sometimes_ I can get pages to download _very_ slowly, but the net connection is more or less dead - and it affects all of the computers on my network, not just the one running KTorrent. When it's in a stalled state, even pinging major sites like yahoo or google pretty much always fails - regardless of which computer on my network I'm pinging from.

After a while (5 - 10 minutes, maybe longer. I haven't timed it), KTorrent will start downloading again and my net connection will be fine. If KTorrent is stalled like I described and I exit KTorrent, my net connection is fine afterward. Restarting KTorrent may or may not get it to start downloading. Some of the time it starts normally and some of the time it pretty much goes back to the stalled state that it was in before I closed it. I don't recall if it ever goes straight to the stalled state without downloading anything, but there are certainly times when it returns to it quite quickly. Some of the time that KTorrent is in a stalled state, it claims to be uploading .1 or .2 KB/S, but not always - and I'm not convinced that it's actually uploading anything when it does. All of the torrents claim to be stalled (or seeding) and the net connection is effectively dead.

In any case, this start and stop behavior is quite odd and certainly irritating, but whatever KTorrent is doing that brings my network to its knees is definitely a problem.

Edit: It should also probably be noted that while my net connection is restored after closing KTorrent, it does not come back immediately. Sometimes it probably takes at least 30 seconds for it to return to normal.
George
Moderator
Posts
5421
Karma
1

Fri Apr 20, 2007 5:07 pm
Are you behind a router ?

I have seen similar things happening on a router which mistook the large amount of connections which are initiated after an announce to a tracker, as a portscan.

This resulted in the router blocking the client almost entirely until the connection attempts stop and some time passed.
Kalessin
Registered Member
Posts
78
Karma
0

Fri Apr 20, 2007 11:26 pm
Yes. I'm behind a router. It's D-Link DI-524. I could certainly understand if that's the problem except that this didn't used to happen to me. It's new. Have there been some changes in the announcing code that might have made it so that there were more connections or something? Of course, I've had more torrents running in the past than I do now and had no problems, so unless there was a change in the code that radically increased the number of connections, I doubt that a change in the number of connections made caused it.

The only changes that I've made to KTorrent or my computer recently are that I switched to Gentoo, actually got port forwarding setup correctly with my router, and changed which TCP port I'm using. I _think_ that I fixed the port forwarding and changed the TCP port that KTorrent is using _after_ the problems started, but I'm not 100% sure. In any case, when I turned off port forwarding, the problem persisted. I suppose that using a high port number instead of a low one may have made my router change behavior.

The biggest change of course was switching to Gentoo. That would have changed a lot, but I haven't a clue as to how that might affect either KTorrent's behavior or the router.

So, likely either a change in something in my system and/or a change in KTorrent convinced my router to change its behavior. I certainly don't see how KTorrent could bring down my connection on its own. Of course, I don't know what would trigger the change in my router's behavior either.
Kalessin
Registered Member
Posts
78
Karma
0

Sat Apr 21, 2007 12:10 am
Well, the change of ports isn't an issue. I changed the TCP port back to 6342 and it still stalled. I'm not sure what else I could do on my end to fix it. The only major change that I'm aware of that I haven't been able to rule out was my change of distributions. I certainly can't reasonably rule that out, but in both cases I was running an SVN snapshot. The one that I'm using is however, more recent.

So, the way it looks to me at the moment, is either a change in KTorrent within the last month - if not less - or a change brought on by switching distributions resulted in my router taking a disliking to me. So, either KTorrent now has a bug that does this or I need to find a way to make my router happy by changing or adjusting something - though I have not clue what.
George
Moderator
Posts
5421
Karma
1

Sat Apr 21, 2007 11:29 am
You could try turning off the firewall on the router and see if that changes anything.
Kalessin
Registered Member
Posts
78
Karma
0

Sun Apr 22, 2007 2:32 am
Well, unfortunately my router won't allow me to turn off its firewall, so I can't try that. About the best that I could do would be to attempt to open every port on the router - which really isn't the same thing as disabling the firewall - and I already have the ports that KTorrent uses open anyway.

By the way, having Konqueror use privoxy as a proxy on 127.0.0.1 to connect to the internet shouldn't affect KTorrent should it? I'm turning it off to see if that affects anything, but I don't see how privoxy could affect KTorrent since I wouldn't think that KTorrent would care much about what Konqueror was doing.
Kalessin
Registered Member
Posts
78
Karma
0

Sun Apr 22, 2007 3:52 am
Well, I turned off privoxy and stopped Konqueror from using it and it doesn't seem to change anything, so that's not the problem. I just installed the latest SVN snapshot, so maybe I'll get lucky and the problem will go away on it's own (well, I can dream can't I....).
Kalessin
Registered Member
Posts
78
Karma
0

Sun Apr 22, 2007 4:50 am
Well, the newest SVN snapshot did not fix the problem. However, I looked at my router's log and it appears that it's been detecting quite a few smurf attacks (apparently they're some kind of denial of service attacks related to pings). I have altered my router's settings so that it blocks all pings from the outside world. I don't know whether this has fixed the problem, but KTorrent sped up considerably and I haven't had it stall within the last half hour or so. Since it hasn't been stalled 100% of the time, I won't know for sure whether the problem has been fixed until I've run it for a while, but blocking incoming pings has at least improved performance.
Kalessin
Registered Member
Posts
78
Karma
0

Sun Apr 22, 2007 5:57 am
Well, unfortunately the problem persists. What makes this so weird is that this didn't used to happen. And what's worse is that it risks making KTorrent unusable - this is especially true since I've now had to reboot the computer and/or the router to get the connection back on a few occasions. The difficulties in restoring the connection may very well have to do with the fact that I'm currently using a wireless connection, but since I was having the problem with a wired connection previously, the lack of wire is not the problem.

I'm afraid that I have no clue as to what I could change on my router to make it happy and if there are any settings changes that I can do to KTorrent that might solve the problem, I don't know what they are. I tried reducing the number of globally allowed connections and that didn't help any. Port changes haven't helped.

I did try at one point to install the 2007-03-31 snapshot to see if it had the problem, but one of my torrents was declared to be in error and was lost and KTorrent kept crashing, so I gave up on that and restored the most recent SVN snapshot.

I'm afraid that I'm pretty much fresh out of ideas. For the moment, I'm going to install Azureus and see if it runs into similar problems. I _really_ want to be using KTorrent, but it doesn't appear to agree with my network at the moment. Maybe if Azureus has similar issues it'll shed some light on things.
Kalessin
Registered Member
Posts
78
Karma
0

Sun Apr 22, 2007 7:21 am
Well, for better or worse, Azureus has exactly the same problem as KTorrent. All of the torrents stall and the network goes dead. At least this shows that the problem definitely isn't caused by a bug in KTorrent (unless of course both KTorrent and Azureus have the same bug, but that isn't all that likely).

I suppose that my next step is to try and run KTorrent on my desktop that still has OpenSUSE 10.1 on it. It hasn't had this problem in the past, so if it does now, the router has definitely decided that it doesn't like me. And if it works just fine, then somehow my Gentoo box has gotten on my router's bad side.

In any case, it's pretty clear at this point that KTorrent is not the issue in any way, shape, or form. As to why this problem has decided to crop up now when it hasn't in the past, I still have to work on that one.
Kalessin
Registered Member
Posts
78
Karma
0

Sun Apr 22, 2007 8:33 am
Well, my desktop with OpenSUSE does not appear to have the same stalling problem with KTorrent that my laptop with Gentoo has. So, I guess I'd better head over to the Gentoo forums to see if I can hunt down a solution. Thanks for the suggestions in any case.
George
Moderator
Posts
5421
Karma
1

Mon Apr 23, 2007 6:55 pm
OK, hope you find a solution
Kalessin
Registered Member
Posts
78
Karma
0

Sat May 05, 2007 5:39 am
Well, my problem appears to be fixed now - though I confess I don't know exactly why. My guess is that one of the packages that I upgraded recently had a bug in the older version that caused the connection trouble when downloading torrents and that the newer version no longer has the bug. It was probably NetworkManager since I updated that just the other day and it's obviously tightly connected with my network connection. Just the same, I don't know for sure which program was causing the problem, but regardless, it appears to be solved now. Finally, I can download torrents with my laptop again!
rapsys
Registered Member
Posts
71
Karma
0

Sat May 05, 2007 6:11 am
Your problem looks like you forget to set global connexion limit in ktorrent.

So on high seeded torrent, ktorrent don't reach any limit and overload your router parallel connexion capacity.

Then no more http or even ktorrent connexion can be estabished until, some of the current one timeout.

If you have set a too important upload limit and global connexion you can fast overload your router.
Kalessin
Registered Member
Posts
78
Karma
0

Sat May 05, 2007 1:49 pm
Changing the global connection limit didn't do anything. I tried it. And regardless of what my settings in KTorrent are, I have the same settings on both my laptop (Gentoo) and my desktop (OpenSuSE). Using KTorrent on my laptop was taking the network down (presumably due to my router freaking out) - regardless of whether I was using a wireless or wired connection. Using KTorrent on my desktop had no problems whatsoever. In addition, using Azureus on my laptop brought the network down in the same manner.

Between the facts that only my laptop had issues and that it had issues with multiple torrent programs, I think that it's apparent that KTorrent was not the problem. And since the problem existed only on my laptop - in spite of the fact that both of my computers were using the same version of KTorrent with the same settings - I don't think that any of the settings were faulty either.

I'm pretty darn sure that there was a network-related program (probably NetworkManager) on my laptop that had a bug that did something that made my router freak out over whatever KTorrent and Azureus were doing. Fortunately, in one of my recent updates, whichever program was giving me the problem was updated and the newest version doesn't have the problem. Since I haven't changed anything else, I don't see what else could have caused the problem. In any case, it's fixed now.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot]