swift-server / swift-server/async-http-client
Keep-alive strategies for connections in connection pool
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 1.1k
- Forks
- 156
- PR merge metrics
- No merged PRs in 30d
Description
Much like grpc-swift already does, in large deployments it's often important to make sure that the HTTP client has for example 1,000 connections ready to go straight away.
Currently, we can't force 1,000 connections to be pre-opened (one problem) but even if we allow AHC to open 1k connections and make it open 1k connections by just creating enough traffic, AHC will close them again. After the idleTimer expires. And we can't just raise the idleTimer to say 8 hours because that usually triggers TCP inactivity timeouts so the connections will be cut from elsewhere.
AHC should support different keep-alive strategies such as:
- TCP keepalives
- sending a
HEAD /request once every 5 mins or so
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the connection pool's existing idleTimer behavior and comparing it with the keep-alive approach in grpc-swift. Done means the HTTP client supports selectable keep-alive strategies, including TCP keepalives and periodic HEAD requests, without connections being closed solely because the idle timer expires.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100