xrpscan / hermes

Project Hermes: XRP Ledger Validation message service
https://xrpscan.com
MIT License
6 stars 4 forks source link

Hot command for reclaim disk #30

Closed shortthefomo closed 1 year ago

shortthefomo commented 2 years ago

Looking for a command to reclaim disk from Hermes.

pkcs8 commented 2 years ago

Hi @lathanbritz,

If you can still connect to mongodb, can you please try this and let me know if it helped?

$ mongosh
test> use hermes_dev
switched to db hermes_dev
hermes_dev> db.validations.deleteMany({ledger_index: {$lt: 75000000}})
{ acknowledged: true, deletedCount: 3981200 }
hermes_dev> db.runCommand({ compact: 'validations' }) 
{ bytesFreed: 1493123072, ok: 1 }
hermes_dev> 

This should delete all validations prior to ledger number 75000000. I will add a PR to Hermes so it does this automatically at user configurable intervals.

pkcs8 commented 1 year ago

online_delete support added to the main branch 59666e70. This would be available in a release soon.

pkcs8 commented 1 year ago

Added a hot command to reclaim disk space in commit a816ff7415e9e36e1134d09352202ca2ded1de93

$ npm run online-delete compact
[online-delete] Compact validations collection: 3.65 MB freed