Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat layer4 pooling and improvements #284

Closed
wants to merge 13 commits into from

Conversation

tarunKoyalwar
Copy link
Member

@tarunKoyalwar tarunKoyalwar commented May 9, 2024

Proposed Changes

  • Superseded by parallel first dial using singleflight #287
  • This pull request (PR) investigates:
    • Dialing connections in parallel to multiple IPs
    • Always dialing in parallel and reusing instead of closing
    • Dialing and caching at layer 4 for reuse by TLS, ZTLS

During the investigation, we concluded that the methods implemented in this PR might not fit the use case and created new issues. This led to the new implementation in #287, informed by our learnings from this PR.

  • Dialing in a single goroutine will not work as we create approximately 10,000 new connections per minute in Golang. Dialing in parallel and caching all connections can cause issues with synchronization and predictive caching.
  • Caching connections can often lead to the error 'use of closed network connection'. This error occurs when TCP keep-alive is not set or expires. While we can enforce this on the client side, servers usually reject any keep-alive requests that last more than 10 seconds [observed on a case-to-case basis during testing].
  • The scope of caching and reusing is relevant and only helpful in the first 10 seconds of its usage.
  • Dialing in parallel and synchronization introduces a worker goroutine and related leaks.

@tarunKoyalwar tarunKoyalwar self-assigned this May 9, 2024
@tarunKoyalwar tarunKoyalwar linked an issue May 9, 2024 that may be closed by this pull request
@tarunKoyalwar tarunKoyalwar changed the title Feat pooling and improvements Feat layer4 pooling and improvements May 9, 2024
@tarunKoyalwar tarunKoyalwar marked this pull request as draft May 9, 2024 21:31
@tarunKoyalwar
Copy link
Member Author

superseeded by #287

@tarunKoyalwar tarunKoyalwar deleted the feat-pooling-and-improvements branch May 23, 2024 13:46
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.

None yet

1 participant