Grist Memory Over Saturated?

My grist document is breaching nearly 80 MB in the Raw Data page and it is getting very slow. I understand I have a lot of data stored with a lot of references to each table but is there a way to mitigate the large latency by chance? Would running this locally help since it is being run via the webpage instead of an actual device.

Thank You!

We had such slowdowns with our database; they were related to the size of the history. There is an endpoint to clear it, that you may use as follows (replace [DOC_ID], [YOUR_API_KEY] and 4 by relevant values :

curl --request POST \
  --url https://docs.getgrist.com/api/docs/[DOC_ID]/states/remove \
  --header 'Authorization: Bearer [YOUR_API_KEY]' \
  --header 'Content-Type: application/json' \
  --data '{"keep": 4}
'
1 Like

Hello @jperon , @paul-grist

As having from time to time similar latency (“still working”) on self hosted Grist instace, I tried your solution.
Yet I have en error → {“error”:“No owner access”} return
I doubled check [Doc_ID] and [API_KEY] → Correct

I may think it is because I am on an electron so Grist-core rev 1.1.7. ?

I don’t think it’s a version problem, as I’ve used this for more than one year. Are you sure the user whose API_KEY you use has owner rights on the document? Do you have access rules that would restrict his actions on this document?

I’m using grist-electron, on this instance there is only one user with all rights everywhere.

  • Should I have to restrict acces, it seems not possible.
    → So I do not think it is a question of user access.

API_KEY → copy paste from parameters :
image

To test API_Key I tested the following :

curl -H "Authorization: Bearer <API-KEY-GOES HERE>" http://192.XXXXXXXX/api/orgs

[{"name":"Personal","createdAt":"2023-01-31T07:50:43.000Z","updatedAt":"2023-01-31T07:50:43.867Z","id":2,"domain":"docs-5","host":null,"owner":{"id":5,"name":"SAMAT_QDb (SAMAT Quality Database)","picture":null,"ref":"7ftY2eZ6qfyPRXMeWy4N62"},"access":"owners"}]

DOC_ ID I’ve tried 2 :

  • image

  • And also the shorter one from the url : 5ARXN8YE2KWz
    Both gives the same result : no owner access

  • I’ve tried changing doc_id → Document not found → coherent

Perhaps you should try from the hosting machine itself: I just tried to do that with grist-electron, and this works:

curl --request POST \
  --url http://localhost:47478/api/docs/[DOC_ID]/states/remove \
  --header 'Authorization: Bearer [API_KEY]' \
  --header 'Content-Type: application/json' \
  --data '{"keep": 4}
'

I tried without success:

  • From the hosting machine with administrative rights
  • with localhost
  • with specific IP
    Same results … well untill now it is not a big issue, but I hope it will not get worst.

Thanks !

Seems to have helped a bit, thank you!