-
Notifications
You must be signed in to change notification settings - Fork 407
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
Large Memory Spike At Checkpoint #2628
Comments
yes checkpoint + transaction logs + unexpired deleted files are your transaction logs very big in size ?. what's your last checkpoint size ? |
transaction logs are ±15k each
last checkpoint size is ±155Mi
|
hmm super weird . maybe @rtyler can you help you more . |
ohno.jpeg 😄 This might be easier to pair with on Slack if you're open @rob-harrison since I have some questions which I doubt you'd want to answer in a public forum about the contents of some of those transaction logs. If there are a lot of actions that are being aggregated together and the checkpoint iteration is few and far between, I can imagine that requiring some hefty memory to compute since we have to load everything into memory. Additionally if the table hasn't been optimized in a while, that can also increase memory with lots of small transactions. |
Following up on the issue reported by @rob-harrison, after talking with @rtyler, we started consistently optimising the table once a day in Spark/Databricks, and it greatly improved memory usage, allowing us to allocate less memory to the service. from delta.tables import *
deltaTable = DeltaTable.forPath(spark, 's3://path/')
deltaTable.optimize().executeCompaction()
deltaTable.vacuum(744) Any improvements to write efficiency would be greatly appreciated, and we'll make sure to keep Thank you for the help! |
Hey, just few questions
Q: was there any performance difference with pyarrow engine vs rust engine in this case ?.
Q: you can do the same from delta-rs also . any special reason for spark ?. |
@sherlockbeard I did not test using the pyarrow engine, so I can't tell. Regarding the second question, initially that is what we did - run an optimiser cronjob. However, this had the same problem as the writer, it required a lot of memory to run and stalled, errored out or got OOMKilled. Our Spark cluster has more resources allocated, I don't know if memory usage was comparable (not monitoring). So basically, we're running on Spark to separate the concerns and make sure the optimisation succeeds. Also, @rtyler recommended this separation, I don't know if he has stronger reasons. |
We have a similar issue as well. Our checkpoint files have reached to 1.4GB. Here are the metadata files in between two checkpoint:
Metadata for checkpoint:
Our memory usage jumped to 13.1 GB when creating the checkpoint: Most of memory allocations happen in We have two theories for the moment:
|
@alexwilcoxson-rel it should help, but I'm not sure how much impact to forecast for the posters with test-cases here |
Environment
Delta-rs version: deltalake==0.18.1
Binding: python (rust engine)
Environment:
Cloud provider: AWS
OS: Mac 10.15.7 and Debian GNU/Linux 12 (bookworm)
Other:
Bug
What happened:
We have a kafka consumer appending batches of records (±6k) to delta using write_deltalake.
Normal working memory is ±600Mi however when delta attempts to write its checkpoint every 100 batches, working memory spikes to ±7Gi (see grafana)
What you expected to happen:
We would expect only a small increase in working memory during checkpoint creation (as it should only need the last checkpoint + transaction logs - right?).
Would appreciate please any insight into why this might be happening and any options to alleviate it.
How to reproduce it:
More details:
The text was updated successfully, but these errors were encountered: