-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
pubsub: machine runs out of memory and crashes #3056
Comments
Just to add to this - this seems to be under load conditions only. I'm unable at the moment to reproduce that load, so I can't double check these results. Towards the end of next week I may be able to reproduce that load, in which case I'll update this issue (if it hasn't been updated / resolved by then). |
I figured out the problem. By default, the Java client caps the amount of "pending bytes". In my testing, each messages are small, so there were probably millions of messages in flight at a given time. Now, the problem is that The fix: Create only one |
Doh - thanks @pongad, testing now |
Hi @pongad - I've refactored out the creation of Especially worrying is Any ideas on what's going on, or what else I can fix? Or do you reckon this is a library issue? |
Hmm..... Could you add subscriberBuilder.setFlowControlSettings(FlowControlSettings.newBuilder().setMaxOutstandingElementCount(100L).build()) ? The default sets the max pending bytes to be a percentage of available memory. I might be possible that the subscriber somehow thinks it has much more memory than it does. If this doesn't help, I think this is a problem with gRPC or Kubernetes (I'm unable to repro on my dev machine, will try to repro on GCE) and we should ask them for help. |
Hey @pongad - I've tried your suggestion. This removes the errors which is 👍 , but the ingestion is quite weird: As you can see, every 30 minutes it stops receiving messages for ~20m. I know that streams are indeed cancelled every 30m, but I would expect the reconnect to happen almost immediately as it does in Go. So the two takeaways here are:
|
I think this is the same problem I sent you an email about. Let's discuss there first.
I'm not totally sure. The Sorry to keep giving work to you, would it be possible make your instance log what |
Hey @pongad, I get |
ping @pongad - is this release blocking? |
Sorry I lost track of this. I think the fix is easy enough that we might as well consider it release blocking. |
This should have been fixed by #3147 |
Hello! I'm running a simple pubsub consumer. This consumer receives a message, waits 5 seconds, and then acks the message. Running this consumer against a subscription with ~600,000 messages causes my app to repeatedly crash as it runs out of memory. This is running on GKE with no special configuration. I'm also using the java config defaults where possible. Possibly worth noting is that I do not see any warning/error logs related to these restarts.
Is this expected? What can be done to prevent this?
Screenshots
Repro
The text was updated successfully, but these errors were encountered: