ocf / rt

Request Tracker service
https://rt.ocf.berkeley.edu
Other
11 stars 5 forks source link

Clean up old RT sessions #19

Open fydai opened 5 years ago

fydai commented 5 years ago

Migrated from https://ocf.io/rt/7334

ja5087 commented 4 years ago

I arrived here after discovering that the RT sessions table was 8GB and maelstrom was running out of space. jvperrin already listed the deets on how to do this but from my experience the script is stupid slow (probably because it does a full table scan and is likely deleting them one by one) and we should just:

1) add an index on lastupdated 2) write our own sql to clean this up ( lastUpdated < time )

in case this still isn't done when I'm old and we still use RT, if the table grows too big just do this:

delete from sessions;
optimize table sessions;