[Operations] Tighten page load bundle size limits #227742
Merged
+191
−188
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Hi Operations team! 👋
Recently I've worked on a few PRs that reduce our page load bundle size, and while doing so I noticed that many of our limits are much higher than the actual page load sizes. It made me think: these limits should be realistic, because they’re one of the main ways we protect page load performance.
Right now, based on the current limits, we theoretically allow up to 11,452,104 bytes (~11 MB) to load upfront. But when we check the real page load, it’s only 5.192.979 bytes — about half of that.
We already have a
--update-limits
flag for thenode scripts/build_kibana_platform_plugins.js --update-limits
command, but it only bumps limits up when the size grows above the limit, adding a flat 15 KB buffer to the bundle size.I’d like to propose:
--update-limits
to allow folks to also lower limits when the bundle shrinks drastically--update-limits
allows for an extra (15KB*197=) 3 MB above the total page size — which is way too much in my opinion!What’s in this PR
✅ Adds logic to let us lower limits automatically, not just bump them up with
node scripts/build_kibana_platform_plugins.js --update-limits
✅ Replaces the flat +15 KB bump with a 10% buffer relative to each plugin’s size when using
node scripts/build_kibana_platform_plugins.js --update-limits
✅ Updated the limits.yml with the result from the above script
Why it matters