ruby / ruby/net-http

Feature Request: Add support for persistent keep-alive connections with auto healing (that can be used to create connection pools)

Aperta
#222 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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.

  1. Define a connection pool
  2. Take a connection from the connection pool and use it from a Sidekiq Job to make the request
  3. Put back the connection in the connection pool
  4. 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. 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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.