Modify the max peer cap

Discussion of Transmission that doesn't fit in the other categories
cschlens
Posts: 1
Joined: Mon Dec 03, 2007 6:03 am

Modify the max peer cap

Postby cschlens » Mon Dec 03, 2007 6:08 am

I am aware that there is a hard coded peer cap of 50 connections, but I thought I read somewhere that this can be modified by going into the source code. Has anyone done this successfully? Please share the knowledge.

Jordan
Transmission Developer
Posts: 2311
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Postby Jordan » Mon Dec 03, 2007 8:05 pm

Raising the maximum number of peers isn't the silver bullet that people seem to think it is. But, since this is a very frequently asked question, maybe it's best to put the information out there anyway. The three constants you'll want to edit are:

libtransmisson/peer-mgr.c: "NUM_CONNECTED_PEERS_PER_TORRENT"
libtransmission/peer-mgr.c: "NUM_UNCHOKED_PEERS_PER_TORRENT"
libtransmission/fdlimit.c: "TR_MAX_SOCKETS"

the first two are self-explanatory, I think. The last one is the 'global' cap of maximum allowed peer connections across all the torrents together.

Again, raising these numbers is not a quick fix for getting your client unchoked by other peers. As you add peers you very quickly reach a point of diminishing returns, plus the growing cost of BitTorrent protocol overhead.

Menthol
Posts: 1
Joined: Sat Dec 08, 2007 1:19 am

Where?

Postby Menthol » Sat Dec 08, 2007 1:25 am

Being a total newbie to a mac I have no idea where to look for this source code, or what to use to edit it...

Can someone with way more knowledge help me out?

The reason why i want to change is that I have a fairly speedy connection and would like to suck down and seed torrents during my off peak hours.

During those hours I want to set the maximum connected peers to way higher than 50.


Thanks,
-Menthol

abelau
Posts: 12
Joined: Tue Jan 15, 2008 11:27 pm

Postby abelau » Fri Feb 01, 2008 1:37 pm

Jordan wrote:Raising the maximum number of peers isn't the silver bullet that people seem to think it is. But, since this is a very frequently asked question, maybe it's best to put the information out there anyway. The three constants you'll want to edit are:

libtransmisson/peer-mgr.c: "NUM_CONNECTED_PEERS_PER_TORRENT"
libtransmission/peer-mgr.c: "NUM_UNCHOKED_PEERS_PER_TORRENT"
libtransmission/fdlimit.c: "TR_MAX_SOCKETS"

the first two are self-explanatory, I think. The last one is the 'global' cap of maximum allowed peer connections across all the torrents together.

Again, raising these numbers is not a quick fix for getting your client unchoked by other peers. As you add peers you very quickly reach a point of diminishing returns, plus the growing cost of BitTorrent protocol overhead.


would you let us know what's the new variables/changes for version 1.04. It looks like the variables you mentioned above is not longer there. I would like to set a lower limit of max total connections because version 1.04 is still crashing my NAT router (using daemon with clutch). Thanks

PS: v1.04 is better than 1, at least it will take something like 15 minutes to crash my NAT router... but still... of cos I'm looking forward to fixing it

Jordan
Transmission Developer
Posts: 2311
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Postby Jordan » Fri Feb 01, 2008 4:02 pm

It can now be set in the preferences dialog. :)

abelau
Posts: 12
Joined: Tue Jan 15, 2008 11:27 pm

Postby abelau » Fri Feb 01, 2008 11:12 pm

Jordan wrote:It can now be set in the preferences dialog. :)


I just upgraded to the latest version of Clutch (0.4), but it doesn't seems to have any settings in the preference dialog. There're options to limit total bandwidth, while nothing for number of network connections. Is it just a feature for the Mac GUI??

Jordan
Transmission Developer
Posts: 2311
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Postby Jordan » Sat Feb 02, 2008 12:54 am

Well, that's a request for the clutch forum. ;)

abelau
Posts: 12
Joined: Tue Jan 15, 2008 11:27 pm

Postby abelau » Sat Feb 02, 2008 2:34 am

Jordan wrote:Well, that's a request for the clutch forum. ;)


Thanks. but is there anywhere in the source that I could modify it at the moment, before it could be set in the Clutch webUI? cos I can't really use the daemon now as the router keeps crashing after a while

http://forum.transmissionbt.com/viewtopic.php?t=3906
edit: it looks like the remote/cli doesn't provide any ways to set the global connection limit yet. Is it true?

pygorex1
Posts: 1
Joined: Sat Mar 28, 2009 4:52 am

Re: Modify the max peer cap

Postby pygorex1 » Sat Mar 28, 2009 5:01 am

For the daemon (and presumably the cli as well) the max global connections can be set in the following config file:

~/.config/transmission-daemon/settings.json (editing this file worked for me)
-or-
~/.config/transmission-cli/settings.json

Look for the line:

"max-peers-global": 200,

And change 200 to whatever value you want. Volia!


Return to “General”