Skip to content
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

Define a max number of image versions to store / gallery view slowness #1167

Open
icarito opened this issue Dec 19, 2019 · 11 comments
Open

Define a max number of image versions to store / gallery view slowness #1167

icarito opened this issue Dec 19, 2019 · 11 comments
Labels
help wanted priority refactoring Refactor code ruby Pull requests that update Ruby code

Comments

@icarito
Copy link
Member

icarito commented Dec 19, 2019

Quoting @jywarren :
"come up with a rubric for max # of versions created PER PERIOD" (...)
this would require some planning and policy discussion.

Not sure how this relates to the features but the thing is that paper-trail gem seems to be related to slowness and it suggests for performance to "limit the number of versions".

From a DBA point of view, currently our heaviest table is "warpables" with 268723 records.
Can we do something to reduce or optimize this?
Thanks!

What happened just before the problem occurred

Relevant URLs

https://

PublicLab.org username

(to help reproduce the issue)

Browser, version, and operating system

For bug reports, fill out the above template; for feature requests, you can delete the template.

@icarito icarito changed the title Define a max number of verions to store Define a max number of versions to store Dec 19, 2019
@icarito
Copy link
Member Author

icarito commented Dec 19, 2019

Actually, talking about heaviest, our "versions" table has 489978 records!

@icarito
Copy link
Member Author

icarito commented Dec 19, 2019

And our "nodes" table has 2746181 records, that is 2.7M records.

@jywarren
Copy link
Member

jywarren commented Dec 21, 2019 via email

@jywarren jywarren changed the title Define a max number of versions to store Define a max number of image versions to store Jan 24, 2020
@jywarren jywarren added help wanted priority refactoring Refactor code ruby Pull requests that update Ruby code labels Jan 27, 2020
@icarito
Copy link
Member Author

icarito commented May 7, 2020

I don't know the cause, but I believe this is slowing the gallery down. While deploying to the Google Cloud helped with performance, this route remains slow (2s-7s)

@jywarren jywarren changed the title Define a max number of image versions to store Define a max number of image versions to store / gallery view slowness May 12, 2020
@jywarren
Copy link
Member

Noting we can limit # of saved versions with this config:

https://github.com/paper-trail-gem/paper_trail#2e-limiting-the-number-of-versions-created

@jywarren
Copy link
Member

Attempted this in #1312 !

@jywarren
Copy link
Member

That is merged and ready for testing in stable! We can also monitor performance in relation afterwards.

@jywarren
Copy link
Member

Confirmed on stable.mapknitter.org that only 20 versions may be saved!

https://stable.mapknitter.org/maps/unc-charlotte-balloon-mapping--2/edit

image

@jywarren
Copy link
Member

I don't think this removes past instances of too many versions though. Not sure!

@jywarren
Copy link
Member

https://stable.mapknitter.org/maps/caldwell-campus/edit shows 38 revisions on an image, so it didn't trim retroactively:

image

@jywarren
Copy link
Member

But i noticed that many images have only 2-5 revisions. So maybe it's not too bad... i had worried that thousands of versions were being saved...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted priority refactoring Refactor code ruby Pull requests that update Ruby code
Projects
None yet
Development

No branches or pull requests

2 participants