rust-synapse-compress-state icon indicating copy to clipboard operation
rust-synapse-compress-state copied to clipboard

Add more examples how to use synapse_auto_compressor

Open rubo77 opened this issue 3 years ago • 3 comments
trafficstars

the readme only suggests

 synapse_auto_compressor -p postgresql://user:pass@localhost/synapse -c 500 -n 100

This means, that it will only check in 100 rooms and quit as I understand is as a layman.

I got the result after 100 chunks:

 INFO  synapse_auto_compressor::manager] Finished running compressor. Saved 15891 rows. Skipped 4/100 chunks                                                                          

this seems to have worked.

Then I started again running with -n 10000 now to try to compress my 56GB database.

Is this the best option? or could you provide more informatinon in the readme please?

rubo77 avatar Jul 12 '22 10:07 rubo77

After some hours it said in the end:

INFO  synapse_auto_compressor::manager] Finished running compressor. Saved 150550506 rows. Skipped 381/3307 chunks

WOW! 150 Million rows in 3307*500=1,700,000 Rooms!

unfortunately the database grew from 56 to 59GB in /var/lib/pistgres, although the gzipped sql export of the table state_groups_state shrinked from 5.6GB to 1.5GB. ( I guess a database VACUUM will be needed in the end?

rubo77 avatar Jul 13 '22 04:07 rubo77

After running VACUUM FULL on my database it shrank down to 23GB.

So we should add this too to the Readme: use VACUUM after compressing to really free up the disk-space.

(I thought we could delete the three extra tables in the database: state_compressor_state, state_compressor_progress and state_compressor_total_progress, but they are so small, that it would be not much space to win)

rubo77 avatar Jul 13 '22 14:07 rubo77

+1 for more examples how to use synapse_auto_compressor and its VACUUM feature.

jahway603 avatar Dec 01 '22 15:12 jahway603