Skip to content

Conversation

@joelanford
Copy link
Member

Signed-off-by: Joe Lanford joe.lanford@gmail.com

Description of the change:
When serving the registry from the model, pre-compute the api.Bundle blobs, save them to disk, and reduce the size of the in-memory model to contain only enough to answer requests by looking up and reading bundles from disk.

Motivation for the change:
This change provides a major memory optimization. Using a real-world file-based catalog (created by migrating a production sqlite-based catalog), the steady state RSS is reduced from 373Mb to 55Mb, an 85% decrease.

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

@openshift-ci openshift-ci bot requested review from benluddy and estroz September 18, 2021 02:37
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 18, 2021
…when serving

Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
@kevinrizza
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2021
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 22, 2021
@codecov
Copy link

codecov bot commented Sep 22, 2021

Codecov Report

Merging #783 (97b731c) into master (3880486) will increase coverage by 0.01%.
The diff coverage is 66.66%.

❗ Current head 97b731c differs from pull request most recent head d490d74. Consider uploading reports for the commit d490d74 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #783      +/-   ##
==========================================
+ Coverage   50.64%   50.65%   +0.01%     
==========================================
  Files         102      102              
  Lines        8846     8879      +33     
==========================================
+ Hits         4480     4498      +18     
- Misses       3522     3530       +8     
- Partials      844      851       +7     
Impacted Files Coverage Δ
pkg/registry/parse.go 73.68% <ø> (ø)
pkg/registry/query.go 60.41% <66.66%> (-1.22%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3880486...d490d74. Read the comment docs.

Copy link
Member

@anik120 anik120 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 22, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 22, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anik120, joelanford

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 9c330a2 into operator-framework:master Sep 22, 2021
@joelanford joelanford deleted the mem-optimize-querier branch September 22, 2021 16:43
akihikokuroda pushed a commit to akihikokuroda/operator-registry that referenced this pull request Sep 30, 2021
…rom disk (operator-framework#783)

* opm serve: pre-compute and store api.Bundles to disk; read from disk when serving

Signed-off-by: Joe Lanford <joe.lanford@gmail.com>

* fix tests

Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
Signed-off-by: akihikokuroda <akihikokuroda2020@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants