Created Socket Manager and Resource Allocation (markdown)

Jari Sundell
2026-06-16 23:00:29 +09:00
parent 66acc7f217
commit 44e8e00171
+62
@@ -0,0 +1,62 @@
## Core Commands
* **`system.sockets.size`**
Returns total open, managed socket descriptors.
* **`system.sockets.max_size`**
Returns absolute global concurrent socket descriptor limit.
* **`system.sockets.max_size.set`**
Sets global socket ceiling and invokes allocation rebalance. Discouraged; file descriptor limits should be defined via operating system `ulimit` settings.
* **`system.sockets.adjust_alloc`**
Triggers immediate runtime resource reallocation and rebalances active category quotas.
* **`system.sockets.<category>.size`**
Returns active connection count within the specified category index.
* **`system.sockets.<category>.max_size`**
Returns current operational ceiling assigned to the category by the last rebalance loop.
* **`system.sockets.<category>.min_alloc`**
Returns configured lower allocation floor constraint for the target category.
* **`system.sockets.<category>.max_alloc`**
Returns configured upper allocation ceiling constraint for the target category.
* **`system.sockets.<category>.min_alloc.set`**
Sets the minimum allocation floor parameter. Non-functional for index 0. Does not trigger immediate rebalance.
* **`system.sockets.<category>.max_alloc.set`**
Sets the maximum allocation ceiling parameter. Non-functional for index 0. Does not trigger immediate rebalance.
## Categories
* **`generic`** (Index 0)
Peer connections and uncategorized connections. Constraints are immutable.
* **`http`**
libcurl HTTP connections.
* **`internal`**
DHT, UDP trackers, internal thread interrupt signals, and BitTorrent listen sockets.
* **`scgi`**
SCGI transport layers and RPC interface backends.
* **`files`**
File descriptors, including memory-mapped filesystem operations (`mmap`).
## Examples
```ini
# 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 =
```