-
Notifications
You must be signed in to change notification settings - Fork 699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot unsubscribe after panic, alloc lots of memory when startup #1614
Comments
Transferring to nats.go repo |
Hey @b04112106, depending on what you need there are few options to achieve automatic cleanup:
Let me know if this answers your question. |
Hi @piotrpio , thank you for the recommandation!! It helps a lot and is precisely what I want. I choose to use memory storage but am afraid of running out of memory. The size of my jetstream is about 14GB and # of consumers is about 6. When I try to update: after
And I found that |
Consumers does not take much space themselves. They do not store messages. Stream does. Can you share your stream config? |
Hi @Jarema , thank you for the reply and here is my stream config!
The stream content is a struct generated by protobuf. The size of message varies from 10^1 KB to 160 KB and it depends on the length of slice. I've already had 1,400,000 messages and the total size is 14 gigabytes. I use pyroscope to monitor the usage of memory and found that if I only call |
What verison of The memory usage depends a lot on traffic, cluster setup, and a lot of other factors. I realized I didn't answer how to manage consumers. You should not delete your |
The version of nats-server is I didn't delete |
After some experiments, we found that the memory usage peak is due to repeatedly The large size of JetStream seems to increase the time consumption of
|
I'm using NATs Server in Go with lines below.
After such operation, there would be a consumer under path like
nats/jetStream/.../<stream_name>/obs/
When I delete the consumer, the consumer under the folder disappears as well.
However, if the process ends abnormally, the consumer under the path would never be removed.
Another issue is that when the jetStream contains lots of messages, it wastes time to recover those consumer.
Is there any method to remove unused consumers before they are recovered? Or I have to remove them after recovering has done?
The text was updated successfully, but these errors were encountered: