mapknitter icon indicating copy to clipboard operation
mapknitter copied to clipboard

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

Open icarito opened this issue 6 years ago • 11 comments

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 avatar Dec 19 '19 05:12 icarito

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

icarito avatar Dec 19 '19 06:12 icarito

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

icarito avatar Dec 19 '19 06:12 icarito

oh no-- versions i think is a relatively new table! Could it be that it's set to save at the wrong trigger, and is just saving endlessly?

On Thu, Dec 19, 2019 at 1:05 AM Sebastian Silva [email protected] wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/mapknitter/issues/1167?email_source=notifications&email_token=AAAF6J6WJGO6E5Z2WUD7OODQZMEZNA5CNFSM4J435MOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHIQR7Y#issuecomment-567347455, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAF6JYXX5OS3MW2BIYW32LQZMEZNANCNFSM4J435MOA .

jywarren avatar Dec 21 '19 02:12 jywarren

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)

icarito avatar May 07 '20 00:05 icarito

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 avatar May 12 '20 22:05 jywarren

Attempted this in #1312 !

jywarren avatar May 19 '20 17:05 jywarren

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

jywarren avatar May 19 '20 17:05 jywarren

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 avatar May 19 '20 17:05 jywarren

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

jywarren avatar May 19 '20 17:05 jywarren

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

image

jywarren avatar May 19 '20 17:05 jywarren

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...

jywarren avatar May 19 '20 17:05 jywarren