Skip to content

Conversation

@Ailsa-Wu
Copy link
Contributor

Summary

As we have disscsused in the issue, we need to improve the performance when dealing with thousands of charts. Therefor, we made some changes as we proposed before.

Changes

Always read from cache in function getIndexFile() without traversing the files on the disk. If cache is missing, rebuild it
Delta update the cache in all the WRITE requests (e.g. POST /api/charts or DELETE /api/charts/)
Delta update the cache every 5min (in case the files on the disk are manually manipulated)
fixes #332

Signed-off-by: Ailsa <ailsa.wu@sap.com>
@thelinuxfoundation
Copy link

Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement.

After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.

Regards,
CLA GitHub bot

@Ailsa-Wu
Copy link
Contributor Author

retrigger

1 similar comment
@Ailsa-Wu
Copy link
Contributor Author

retrigger

Signed-off-by: Ailsa <ailsa.wu@sap.com>
@Ailsa-Wu Ailsa-Wu force-pushed the feature/issue-332 branch 2 times, most recently from 82bdaec to a64e15b Compare June 11, 2020 05:37
@Ailsa-Wu
Copy link
Contributor Author

retrigger

@Ailsa-Wu Ailsa-Wu force-pushed the feature/issue-332 branch from a64e15b to 8398ab2 Compare June 15, 2020 08:24
@Ailsa-Wu
Copy link
Contributor Author

retrigger

@Ailsa-Wu Ailsa-Wu force-pushed the feature/issue-332 branch from 3f2b462 to a188b9b Compare June 24, 2020 05:28
@Ailsa-Wu
Copy link
Contributor Author

HI @scbizu , I have made all the check passed, may I have your review one more time ? Appreciate it!

@Ailsa-Wu
Copy link
Contributor Author

Ailsa-Wu commented Jul 1, 2020

hi @jdolitsky , I made some changes to improve the performance of Chartmuseum. It has worked well for about 3 weeks in our prod system. May I have a review? Hoping it is useful and can be merged to master. Thanks very much.

Copy link
Contributor

@jdolitsky jdolitsky left a comment

Choose a reason for hiding this comment

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

@Ailsa-Wu glad to hear this change is working well for you.

There is a lot going on here - I left some comments with mostly questions to understand your approach

Signed-off-by: Ailsa <ailsa.wu@sap.com>
@Ailsa-Wu Ailsa-Wu requested a review from jdolitsky July 2, 2020 07:23
// It is not crucial if this does not succeed, we will just log any errors
go server.saveStatefile(log, repo, ir.index.Raw)
objects := server.getRepoObjectSlice(entry)
diff := cm_storage.GetObjectSliceDiff(objects, fo.objects, server.TimestampTolerance)
Copy link

@steven-zou steven-zou Jul 8, 2020

Choose a reason for hiding this comment

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

@Ailsa-Wu, @jdolitsky

Will this method(GetObjectSliceDiff ) refer to the latest improved version?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just updated to latest storage release so yes 👍

Choose a reason for hiding this comment

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

Very !

@steven-zou
Copy link

steven-zou commented Jul 8, 2020

@jdolitsky

When can this PR be merged and released? As you know, Harbor is depending on Chartmuseum to provide HELM V2 chart management capabilities (still existing together with HELM V3 OCI supporting way for a reasonable time) and some of the Harbor users have met the serious perf issues of managing charts when there are large scale charts at the backend storage. Hope this PR can fix such perf issues of Chartmuseum. Looking forward to its merging and releasing.

@scbizu
Copy link
Contributor

scbizu commented Jul 8, 2020

Would this PR largely increases the memory that chartmuseum uses since we will maintain a large runtime cache? Should we cache all of the "thousands of" charts ?

@jdolitsky
Copy link
Contributor

will take a look at this ASAP

@Ailsa-Wu
Copy link
Contributor Author

hi @jdolitsky , may I have your review one more time?

@jdolitsky jdolitsky changed the base branch from master to main September 13, 2020 20:00
@jdolitsky
Copy link
Contributor

@Ailsa-Wu - thanks so much for your patience. Finnally had a chance to look into this, and the change seems to work as expected. Merging.

@steven-zou - planning to cut a v0.13.0 release this week (thanks for Hrabor team patience as well)

@jdolitsky jdolitsky merged commit 68532a8 into helm:main Sep 13, 2020
@jdolitsky
Copy link
Contributor

Please see docs on this new feature: https://github.com/helm/chartmuseum#cache-interval

@mikhail-putilov
Copy link

@jdolitsky hi :-)

Do you have any news about planned 0,13 release?

I am really anticipating this PR to be part of the next release.
Currently I am waiting 8 minutes to build a umbrella chart, it might speed up the building a lot

Regardless of the answer, I wanted to thank you for your contribution to open source, I really like chartmuseum :-)

@jdolitsky
Copy link
Contributor

@mikhail-putilov - I appreciate the kind words. Will try to get 0.13 out later in this week

@jdolitsky jdolitsky added this to the v0.13.0 milestone Nov 12, 2020
@peppe77
Copy link

peppe77 commented Nov 17, 2020

@jdolitsky when will v0.13.0 be released? we have been experiencing this issue (#339), therefore heavily interested to upgrade to v0.13.0as it will hopefully solve the problem. thanks

@djotanov
Copy link

I am interested as well when will the next version be relased?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance downgrade when dealing with thousands of charts

10 participants