From 929d64e7c75fde1cadd0d405c1ea92de7b43013b Mon Sep 17 00:00:00 2001 From: Jari Sundell Date: Tue, 16 Jun 2026 23:10:13 +0900 Subject: [PATCH] Updated Socket Manager and Resource Allocation (markdown) --- Socket-Manager-and-Resource-Allocation.md | 29 +++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/Socket-Manager-and-Resource-Allocation.md b/Socket-Manager-and-Resource-Allocation.md index 8d9fec9..3d0281d 100644 --- a/Socket-Manager-and-Resource-Allocation.md +++ b/Socket-Manager-and-Resource-Allocation.md @@ -33,20 +33,35 @@ ## Categories -* **`generic`** (Index 0) - Peer connections and uncategorized connections. Constraints are immutable. +* **`generic`** + Peer connections and uncategorized connections. This category does not have `min/max_alloc` as it receives the remaining allocation. * **`http`** - libcurl HTTP connections. + HTTP connections. * **`internal`** - DHT, UDP trackers, internal thread interrupt signals, and BitTorrent listen sockets. + DHT, UDP trackers, listening and various internal sockets. -* **`scgi`** - SCGI transport layers and RPC interface backends. +* **`rpc`** + RPC related sockets. * **`files`** - File descriptors, including memory-mapped filesystem operations (`mmap`). + File descriptors. + + +## Default Allocation Constraints + +| open_max | generic minimum | reserved | http | internal | rpc | files | +| :--- | :--- | :--- | :--- | :--- | :--- | :--- | +| **$\ge$ 32768** | 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 or when calling `adjust_alloc` using _ulimit open files_. + +Allocation to other categories result in `generic` receiving less than `generic minimum` an `internal_error` is thrown. ## Examples