Relay CPU goes to portable ChaCha20-Poly1305 instead of AES-GCM

Aperta
#10,283 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start by tracing TLS cipher suite negotiation and the provider's suite ordering, then check where rind supplies ChaCha20 and AES backends. Reproduce the relay profile on a host with AES-NI and compare the negotiated suite and CPU profile before and after a maintainer-approved change. Done means the cause is identified and the same workload shows a measured improvement.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

In a profile of a relay serving many SD subscribers, the top self-time was portable ChaCha20-Poly1305 from rind:

  • rind::low::generic::chacha20::keystream: 18.0%
  • rind::low::generic::poly1305::Poly1305::add_bytes: 4.0%
  • rind::low::generic::chacha20poly1305::cipher: 1.1%

That's about 23% of the relay's CPU in the generic (non-SIMD) code path. An earlier profile of the same workload showed AES-GCM at 2.4%, so either the suite that gets negotiated changed, or the AES backend did.

Work

  • Find out why these sessions negotiate TLS13_CHACHA20_POLY1305_SHA256 rather than AES-128-GCM on hosts with AES-NI. It could be the client's suite order, the server's preference, or how the provider lists its suites.
  • Then do one or both of these, which is a decision for the maintainer:
    • On hosts with hardware AES, have the server prefer AES-GCM.
    • Give rind's ChaCha20 a SIMD backend.
  • Measure before and after, using the same profile.

(Written by Claude Opus 5.5 with high)

Lingua principale
Rust
Stelle
1.6k
Fork
251
Merge medio
10h 10m
PR unite (30g)
832

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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.

Altre issue di moq-dev/moq

Tutte le issue di moq-dev/moq

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.