-
Notifications
You must be signed in to change notification settings - Fork 13.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
perf(core): Batch items sent in runonceforeachitem mode (no-changelog) #11870
perf(core): Batch items sent in runonceforeachitem mode (no-changelog) #11870
Conversation
02776b7
to
160e6e6
Compare
To reduce memory footprint, execute runOnceForEachItem in chunks of 1000 items at a time. This makes the execution a bit slower but reduces the max memory usage. In the future we could consider e.g. sampling the input data and determine the chunk size based on that.
160e6e6
to
c28fe39
Compare
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/cli/src/runners/task-managers/data-request-response-stripper.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/runners/task-managers/data-request-response-stripper.ts
Show resolved
Hide resolved
packages/@n8n/task-runner/src/data-request/data-request-response-reconstruct.ts
Outdated
Show resolved
Hide resolved
packages/@n8n/task-runner/src/data-request/data-request-response-reconstruct.ts
Show resolved
Hide resolved
@ivov Interesting.. I was not able to reproduce this. Does it happen consistently? |
…tripper.ts Co-authored-by: Iván Ovejero <[email protected]>
@ivov thank you for the review 🙌 Addressed all the comments. Please have another look 🙇 |
n8n
|
Project |
n8n
|
Branch Review |
cat-300-memory-batch-items-sent-in-runonceforeachitem-mode
|
Run status |
|
Run duration | 04m 32s |
Commit |
|
Committer | Tomi Turtiainen |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
1
|
|
0
|
|
0
|
|
478
|
View all changes introduced in this branch ↗︎ |
✅ All Cypress E2E specs passed |
This happens consistently. We should look into this separately. |
Got released with |
#11870) Co-authored-by: Iván Ovejero <[email protected]>
Summary
To reduce memory footprint, execute runOnceForEachItem in chunks of 1000
items at a time. This makes the execution a bit slower but reduces the max
memory usage. In the future we could consider e.g. sampling the input data
and determine the chunk size based on that.
Also remove
N8N_RUNNERS_ASSERT_DEDUPLICATION_OUTPUT
as it can't be checked in all cases anymore and we haven't had any assertion issues with it.Tested using this WF:
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/CAT-300/[memory]-batch-items-sent-in-runonceforeachitem-mode
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)