-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Memory usage while consuming #81
Comments
Also- I see there is a 'queued.min.messages' but no queued.max.messages? |
In case if wasn't obvious, can reproduce with sleep () rather than with slow disk |
rdkafka will fetch more messages as long as there are less than |
Yes, but what if I want it to STOP fetching messages? My issue is that without a max, it will continue to fetch and use huge amounts of memory. On Tuesday, February 18, 2014, Magnus Edenhill [email protected]
|
It will stop when the queued.min.messages threshold is reached, and start fetching again whenever it drops below that threshold. |
ok - that worked. Although I wouldn't mind if you offered a config parameter that says when the total bytes queued is 'X', then stop consuming. This allows you to control the amount of memory used when you don't know the size of the upcoming messages available on the wire. |
The maximum memory consumption (per consumed toppar) should be close to |
Allowing some factor of overhead, does this match the memory consumption you're seeing in your application? |
That's hard for me to know since the message sizes coming in random. That's why I'd like to be able to control the number of messages based on memory. This way if messages coming in are small, I can ask for more of them. If messages are large, I don't run out of memory. I am not worried about getting a single huge message such that message.max.bytes really figures in. Let's say I only want to queue up 500 MB of memory. I'd like to be able to configure it such that librdkafka gets as many messages queued as possible without going over. |
Okay, a |
A queued.max.bytes property. It's the threshold beyond which I don't want On Thu, Feb 20, 2014 at 11:13 PM, Magnus Edenhill
|
Myeah, it might seem a little odd. If I added a queued.max.bytes property it would be a soft-limit, it would still queue all messages received in the fetch reply, possibly overshooting the queued.max.bytes value by some amount (up to message.max.bytes). Otherwise rdkafka would have to drop received messages to satisfy the maximum queue limit, just to refetch them in a short while again. I'm rambling. |
Yeah, you're rambling. Bottom line, I want to safe guard against running On Thu, Feb 20, 2014 at 11:27 PM, Magnus Edenhill
|
I'll add |
Have you had time to verify that |
Sorry, haven't had a chance yet. |
Okay, I'll close it anyway, reopen if you see the problem again (impossible!). |
@winbatch Going through this discussion I am wondering why you ran out of memory ? The default value for |
@kant111 - This was more than 3 1/2 years ago and I'm sure many versions of kafka and librdkafka ago. |
@winbatch I am sorry I did not understand your latter part of the sentence. |
Have you ever seen a case where when consuming, if the consumer can't keep up (let's say he is writing each message to slow disk), that the amount of memory explodes? I'm seeing that. I've run valgrind and don't see any leaks, etc. thinking librdkafka is caching msgs but I haven't changed any of the defaults in terms of fetch.message.max.bytes, etc.
The text was updated successfully, but these errors were encountered: