Page 1 of 1

Modify the max peer cap

Posted: Mon Dec 03, 2007 6:08 am
by cschlens
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.

Posted: Mon Dec 03, 2007 8:05 pm
by Jordan
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.

Where?

Posted: Sat Dec 08, 2007 1:25 am
by Menthol
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

Posted: Fri Feb 01, 2008 1:37 pm
by abelau
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

Posted: Fri Feb 01, 2008 4:02 pm
by Jordan
It can now be set in the preferences dialog. :)

Posted: Fri Feb 01, 2008 11:12 pm
by abelau
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??

Posted: Sat Feb 02, 2008 12:54 am
by Jordan
Well, that's a request for the clutch forum. ;)

Posted: Sat Feb 02, 2008 2:34 am
by abelau
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?

Re: Modify the max peer cap

Posted: Sat Mar 28, 2009 5:01 am
by pygorex1
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!