the forums at degreez.net

It is currently Wed Apr 24, 2024 6:40 pm

All times are UTC - 7 hours [ DST ]




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
PostPosted: Wed May 05, 2004 7:49 pm 
Hey, there. I'm using Bittornado in NetBSD and every so often this error creeps up on me.

ERROR (Time) -
IO Error: unable to open "filename" [Errno 24] too many open files 'files'

Then BT stops working. This happens when I download torrents that have alot of files in their directory. I thought this was NetBSD specific but my friends who use linux have the same problem creep up even more often than I do. Do you know of any work arounds for a problem like this?


Top
  
 
 Post subject:
PostPosted: Wed May 05, 2004 9:11 pm 
Offline

Joined: Sun Mar 07, 2004 10:05 am
Posts: 1212
Prefs/Advanced/set Max files open back down to 50. I added this feature to my client specifically to fix this problem.

If # files is set at 50 and you're still getting the problem, something's wrong with your kernel settings. Default for most *nixes is 512 or 1024 file handles max. Could some other app be using up your handles?


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 05, 2004 10:07 pm 
Thanks for pointing out the feature. It is already set to 50. Pehaps I should turn up the value instead since their are more than 50 files in some of the torrents I'm downloading.

I was wondering if python as the problem since doing an sysctl -a shows my system wide limit as 1024 open files and my per-process limit is 256. I don't have any programs running most of the time when BT is going so I knew it couldn't be an other app.


Top
  
 
 Post subject:
PostPosted: Wed May 05, 2004 10:35 pm 
Offline

Joined: Mon Mar 15, 2004 8:35 am
Posts: 418
If you think it is python, here is a test program I wrote up that you could use to test.

The below code opens up to a max of 2000 files (and creates them in the process of doing that) with the name of deleteme*.txt. If it fails for any reason, it will print out how many files were successfully open. When it is done running, you can clean up the files by deleting the "deleteme*.txt" files it creates in the same folder you ran it in.

Before running this program, be sure to make a temp folder and then copy this program to that temp folder and run it from the temp folder.

Code:
openfiles = []
try:
  for x in range(2000):
     openfiles.append(open("deleteme" + str(x) + ".txt", "a+"))
except:
  pass

print "I successfully got", len(openfiles), "files open!"


In linux, with a limit of 1024, I successfully was able to open 1021 files.

What is the number you get with this?


Last edited by bytetorrent on Wed May 05, 2004 11:41 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed May 05, 2004 11:14 pm 
....59


Top
  
 
 Post subject:
PostPosted: Wed May 05, 2004 11:36 pm 
It's especially strange since a similar perl script gives me 1017. I'm going assume it is python. I downloaded a binary when I installed python cause I was lazy (as did all my friends). I'm going to install it from source and see where that gets me. Thnaks for the tip off bytetorrent.


Top
  
 
 Post subject:
PostPosted: Thu May 06, 2004 12:00 am 
Alright this thread can be closed now I guess. It turns out that the precompiled binary of python didn't have the appropriate privalages to change certain per process values. When I compiled it from source it now seems to have all the neccesary privalages to change values according to my sysctl. Very odd. The more I have trouble with binaries the more I hate them. :shock:


Top
  
 
 Post subject:
PostPosted: Tue May 11, 2004 11:00 am 
Offline

Joined: Sat Mar 13, 2004 3:31 pm
Posts: 19
And that is why, my friend, you should ALWAYS compile from source. =)


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 16, 2004 8:18 pm 
Offline

Joined: Sun Mar 07, 2004 10:05 am
Posts: 1212
Just FYI, I found out that this can also occur due to a bug in some BSD installs. To diagnose, do "lsof" and look for a lot of entries marked KQUEUE.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 161 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group