Skip to content

Conversation

Abidbdwork
Copy link

No description provided.

google-labs-jules bot and others added 2 commits September 23, 2025 05:10
The server was failing with a "Too many open files" error when handling a large number of concurrent connections. This was because each new connection would spawn a new task that would open a new socket, quickly exhausting the available file descriptors.

This commit fixes the issue by introducing a `tokio::sync::Semaphore` to limit the number of concurrently running connection handler tasks. The maximum number of concurrent tasks is controlled by the `--concurrent` command-line argument.

This prevents the server from opening an excessive number of sockets simultaneously, resolving the error and improving stability under heavy load.
@0x676e67 0x676e67 changed the title Fix/too many open files feat(socks): enforce semaphore to limit connection count Sep 23, 2025
@0x676e67
Copy link
Owner

Can you also add limits for the HTTP/HTTPS servers? It would be best to complete it within the same PR so that this issue won’t need to be handled again in the future.

@0x676e67 0x676e67 closed this Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants