Feature Request: Add support for persistent keep-alive connections with auto healing (that can be used to create connection pools)
Nessuno ha ancora preso questa issue.
- Lingua principale
- Ruby
- Stelle
- 148
- Fork
- 95
- Merge medio
- 10h 54m
- PR unite (30g)
- 4
Descrizione
Hello,
We have a scenario (push service) where we need to send thousands of HTTP requests per second to the same host. We use Sidekiq to scale this workload. The problem is that every request (in a Sidekiq Job) starts a new connection, makes the request, closes the connection.
It would be a great performance improvement if we could use a gem like this https://github.com/mperham/connection_pool to create a connection pool for HTTP requests.
- Define a connection pool
- Take a connection from the connection pool and use it from a Sidekiq Job to make the request
- Put back the connection in the connection pool
- The connection can be reused by other Sidekiq Jobs to make other HTTP requests to the same host.
The problem, as described in the ConnectionPool readme, is this:
connections should be self-repairing.
For example if a keep alive connection is closed on the server side, this library gives errors, but does not retry / repair the connection automatically.
It would be great to have support for persistent keep-alive connections and auto healing directly in Ruby.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia leggendo il ciclo di vita delle connessioni esistente di Net::HTTP e il README di connection_pool a cui si fa riferimento nell’issue. Definisci come le connessioni persistenti vengono raccolte in un pool, riutilizzate tra i job di Sidekiq e riparate dopo la chiusura da parte del server; il completamento richiederebbe un comportamento concordato e test per questi casi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- ruby
- Ambito
- networking
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100