mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-05 08:05:12 +00:00
The 1 GiB default introduced in v0.2.20 is shared by every group on an instance and stays charged for the whole streaming response, so large hosts under high concurrency returned 503 "Request body buffering capacity is exhausted" long before memory was actually short. When gateway.request_body_memory_budget_bytes is set in neither the config file nor a non-empty env var, size it to 1/4 of the process memory limit (min of physical RAM, cgroup v1/v2 limit along the cgroup path, and GOMEMLIMIT), never below the previous 1 GiB. Explicit values, including 0, are used as-is. The example config no longer pins 1 GiB.