Opened 12 years ago

Closed 12 years ago

#1506 closed Enhancement (worksforme)

patch to correct not enough file handle problems

Reported by: spaham Owned by: livings124
Priority: Normal Milestone: None Set
Component: Mac Client Version: 1.40
Severity: Normal Keywords:


The max number of open files seems to be quite low with the current version of transmission, I had errors opening new sockets, the web interface was not responsive or 404 etc, just because of a few big torrents (ie many files) and many peers.

Here is a simple patch I wrote that ups the max number of files (file is generic for sockets/files/...) I don't see any downside, besides maybe a few extra kbytes used.

I took the code from bench.c, and put it in the main() func, but you'll probably know where it would be best put. I set it at 2048, ymmv...

here's the new version of main() in main.m :

int main( int argc, char argv ) {

#ifndef WIN32

struct rlimit rl;


if( argc > 1 && !strncmp( argv[1], "-v", 2 ) ) {

char * env; int debug = atoi( &argv[1][2] ); asprintf( &env, "TR_DEBUG=%d", debug ); putenv( env ); free( env );


#ifndef WIN32

rl.rlim_cur = rl.rlim_max = 2048;

if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {

perror("setrlimit"); exit(1);



return NSApplicationMain( argc, (const char ) argv );


Change History (5)

comment:1 Changed 12 years ago by charles

spaham: Is this still relevant after r7138?

comment:2 Changed 12 years ago by spaham

I compiled against 7084 from what I see in the app's Info.plist file. I'll check with latest svn.

comment:3 Changed 12 years ago by livings124

spaham: ping

comment:4 Changed 12 years ago by spaham

I haven't been able to reproduce the problem (ie not enough files or peers at the same time) All I can say now is that it won't hurt to have the max number of files a bit higher than the default I guess it only eats a few bytes...

comment:5 Changed 12 years ago by livings124

  • Resolution set to worksforme
  • Status changed from new to closed

Let's leave it as-is then. The reports of this issue are non-existent afaict.

Note: See TracTickets for help on using tickets.