nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
15.1k stars 1.36k forks source link

High leader memory usage with millions of messages (jetstream) #5596

Open michaelmohamed opened 4 days ago

michaelmohamed commented 4 days ago

Observed behavior

I am using nats-server w/ jetstream via helm charts on k8s to process about 40 million messages.

I have 30 pull-based consumers.

The leader (nats-2) seems to be using a lot of memory compared to the nats-0 and nats-1. Is this normal? Is there a way to minimize the amount of memory used?

image

Other info:

image image

Expected behavior

Lower memory use.

Server and client version

nats-server: v2.10.16 nats-py: v2.7.2

Host environment

I am using nats-server via helm charts on k8s (EKS)

Steps to reproduce

No response