-
-
Notifications
You must be signed in to change notification settings - Fork 473
Socket Manager and Resource Allocation
-
system.sockets.sizeReturns total open, managed socket descriptors. -
system.sockets.max_sizeReturns absolute global concurrent socket descriptor limit. -
system.sockets.max_size.setSets global socket ceiling and invokes allocation rebalance. Discouraged; file descriptor limits should be defined via operating systemulimitsettings. -
system.sockets.adjust_allocTriggers immediate runtime resource reallocation and rebalances active category quotas. -
system.sockets.<category>.sizeReturns active connection count within the specified category index. -
system.sockets.<category>.max_sizeReturns current operational ceiling assigned to the category by the last rebalance loop. -
system.sockets.<category>.min_allocReturns configured lower allocation floor constraint for the target category. -
system.sockets.<category>.max_allocReturns configured upper allocation ceiling constraint for the target category. -
system.sockets.<category>.min_alloc.setSets the minimum allocation floor parameter. Non-functional for index 0. Does not trigger immediate rebalance. -
system.sockets.<category>.max_alloc.setSets the maximum allocation ceiling parameter. Non-functional for index 0. Does not trigger immediate rebalance.
-
genericPeer connections and uncategorized connections. This category does not havemin/max_allocas it receives the remaining allocation. -
httpHTTP connections. -
internalDHT, UDP trackers, listening and various internal sockets. -
rpcRPC related sockets. -
filesFile descriptors.
| open_max | generic minimum | reserved | http | internal | rpc | files |
|---|---|---|---|---|---|---|
| 12288 | 512 | 128 | 64 | 64 | 4096 | |
| 16384 to 32767 | 12288 | 512 | 128 | 64 | 64 | 2048 |
| 8096 to 16383 | 6144 | 256 | 64 | 32 | 48 | 1024 |
| 1024 to 8095 | 512 | 128 | 32 | 32 | 32 | 128 |
| < 1024 | 256 | 64 | 16 | 16 | 16 | 64 |
The baseline descriptor limits for each socket category are auto-calculated at startup (using ulimit -n) or when calling adjust_alloc (using system.sockets.max_size).
Allocation to other categories result in generic receiving less than generic minimum an internal_error is thrown.
# Increase allocation to the files category, e.g. if max_open is 16k it would be 2048.
system.sockets.files.min_alloc.set=4096
system.sockets.adjust_alloc=
# Restrict to 512 if you have mostly single-file torrents and want more peer connections.
system.sockets.files.max_alloc.set=512
system.sockets.adjust_alloc=