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

[bug] "Too many open files"

Tags: None
(comma "," separated)
BloodyNO
Registered Member
Posts
3
Karma
0

[bug] "Too many open files"

Tue Apr 04, 2006 3:00 pm
Hello,

while I was downloading a quite big torrent with many seeders and leechers KTorrent stopped with this message: "Cannot open [...]: Too many open files". When I restart the torrent and check the chunks part I see many many chunks downloading (circa 50) - I think this might have caused the problem. In the options dialog I don't see any option to control the numer of chunks that may be downloaded at the same time, I tried to set connection count from 120 to 80, but this didn't work.

I hope you can add an option to control these numbers, or have another solution for my problem. Thanks for the great application and thanks in advance!

[edit]Oh sorry, I almost forgot to tell my specs:
- KDE 3.5.1
- KTorrent 1.2
- Qt 3.3.4
- Kernel 2.6.15
- ReiserFS 3.6 filesystem
- Gentoo ~amd64
[/edit]
stoeptegel
Registered Member
Posts
1075
Karma
0

Tue Apr 04, 2006 3:09 pm
It's because it's a system level thing. You can type ulimit -a to see the limit.

What version are you using? I remember there was a fix that closed the files don't needed.

EDIT:
The fix is after the 1.2 release, so it's probably taken care off in the next release. :)
For a quick fix i heared you can do # ulimit -n 2048, although on my kubuntu sudo can't find ulimit.(?)
BloodyNO
Registered Member
Posts
3
Karma
0

Tue Apr 04, 2006 4:10 pm
Thank you! I'll use this work-around until the next stable version is released.

Trouwens, stoeptegel klinkt Hollands/Belgisch ;)

EDIT: Leiden ligt in Nederland ja :P

EDIT2: I tried both, first 2048 open files, now 4096, this is just too much. I'm installing the SVN-version now.
stoeptegel
Registered Member
Posts
1075
Karma
0

Thu Apr 06, 2006 11:19 pm
BloodyNO wrote: I'm installing the SVN-version now.


At the moment you said this there was a SVN issue with "make", but you have a green light now.

Dutch citizen indeed. Will i still be safe in Leiden now the internet knows? ;)
BloodyNO
Registered Member
Posts
3
Karma
0

Fri Apr 07, 2006 1:56 pm
stoeptegel wrote:
BloodyNO wrote: I'm installing the SVN-version now.


At the moment you said this there was a SVN issue with "make", but you have a green light now.

Dutch citizen indeed. Will i still be safe in Leiden now the internet knows? ;)


Yes indeed, a make error occured at my place. Therefore I had modified those make-files, I switched the plugins off. I have build the correct version now. Thanks for notifying me!

Whether you are safe in Leiden? Next year I will live in Delft, so I guess not. ;)
C-MoH
Registered Member
Posts
6
Karma
0
OS

Sun Jun 11, 2006 2:00 pm
I've seem to have found that the same problem arises with more torrents having few files, but many peers... or having a single torrent with many files, but not exceeding the ulimit. Downloads annoyingly stop with "Error: cannot open blah blah: too many open files".

I don't think it's related to the preallocation, since it occurs when most of the torrent was already downloaded, and thus the no. of peers is very high (around 500). By using lsof | grep ktorrent | grep IPv4 | wc -l I found that the error mostly occurs when connection count approaches 1024 (also the ulimit default).

As a solution, why not limit the total number of connections to the user-set ulimit ?

EDIT: Or a solution (good enough for me, at least), would be to restart downloads affected by this particular error. The annoying part is that one has to monitor the download and restart it by hand. The above one is cleaner, still.
George
Moderator
Posts
5421
Karma
1

Sun Jun 11, 2006 3:18 pm
C-MoH wrote:I've seem to have found that the same problem arises with more torrents having few files, but many peers... or having a single torrent with many files, but not exceeding the ulimit. Downloads annoyingly stop with "Error: cannot open blah blah: too many open files".

Each socket (network connection) is also counted as a file (in unix everything is a file)

I don't think it's related to the preallocation, since it occurs when most of the torrent was already downloaded, and thus the no. of peers is very high (around 500). By using lsof | grep ktorrent | grep IPv4 | wc -l I found that the error mostly occurs when connection count approaches 1024 (also the ulimit default).

As a solution, why not limit the total number of connections to the user-set ulimit ?


Well we allready have a maximum number of connections per torrent. Maybe a global one isn't a bad idea.


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]