You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the cleartokens command to clear the expired tokens from my MySQL database and try to improve performance. However, we got to a point where we have a lot of tokens in our database (~300 MM) because of a bug in another application.
The command no longer workers because the delete() method from Django tries to load the entire object list to the python memory. The task will make the machine CPU goes to 100% and won't be able to delete anything.
I think we should have some alternatives to clear the tokens. Maybe some kind of pagination so it would delete X tokens at a time or maybe using the _raw_delete() method from Django ORM.
Is that an acceptable resolution for the problem? I can try and work in a PR to address this issue.
The text was updated successfully, but these errors were encountered:
I'm using the
cleartokens
command to clear the expired tokens from my MySQL database and try to improve performance. However, we got to a point where we have a lot of tokens in our database (~300 MM) because of a bug in another application.The command no longer workers because the
delete()
method from Django tries to load the entire object list to the python memory. The task will make the machine CPU goes to 100% and won't be able to delete anything.I think we should have some alternatives to clear the tokens. Maybe some kind of pagination so it would delete X tokens at a time or maybe using the
_raw_delete()
method from Django ORM.Is that an acceptable resolution for the problem? I can try and work in a PR to address this issue.
The text was updated successfully, but these errors were encountered: