The aggregation of the CompressionProvider to prevent the large numbers of memory used by the underlying Zstd Libs

Aperta
#1,344 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go

Direzione di ricerca

Traccia la relazione tra PartitionProducer, CompressionProvider e zstdprovider, concentrandoti su come i cambiamenti della partizione RoundRobin mantengono lo stato di compressione e su come CompressionLevel lo influenza. Conferma il comportamento di ritenzione della memoria e definisci il completamento come la riduzione della crescita di memoria segnalata per partizione senza modificare il comportamento del producer.

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

Descrizione

Is your feature request related to a problem? Please describe.

Backgroud: In the scene of log collecting, a go application will collecting logs from many different business sides, and produce to individual topics in Pulsar. So a go application have to create many topic producers, and each may have many partition producers.

Problem: The implementation of the PartitionProducer each holds an CompressionProvider, which eventually holds an instance of the zstdprovider(for pure go context, this may use the github.com/klauspost/compress/zstd).
The zstdprovider will each occupy a large byte slice for storing the history data to improve the compress ratio. And this will only release when the partition producer close. But the partition producer will never close except for the topic producer to be closed.
So, this will lead to the slow(or quick) increasing of the memory of the Go application, which may eventually lead to the frequent OOM of the Go application. It just seems like the leaking of the memory in the partition strategy of RoundRobin( and other partition strategies, which may change the producing partition with the time).

Describe the solution you'd like
1# Just reduce the Compression Provider according to the CompressionLevel will solve this problem.

Lingua principale
Go
Stelle
746
Fork
394
Merge medio
6g 13h
PR unite (30g)
7

Preparare l'ambiente

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 apache/pulsar-client-go

Tutte le issue di apache/pulsar-client-go

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.