ether / etherpad-lite

Etherpad: A modern really-real-time collaborative document editor.
http://docs.etherpad.org/
Apache License 2.0
16.71k stars 2.85k forks source link

Is there anyway to reduce the mysql database size? #5576

Closed cenotaph closed 1 year ago

cenotaph commented 2 years ago

Hi,

I help keep etherpad-lite running for a nonprofit organisation who has depended on it for years. Last year the mysql .ibd file was over 26GB and was filling up the VPS, so we decided to install a fresh empty etherpad-lite installation and move the old pads over to an 'archive' server.

Now, less than a year later, the archive server has filled the disk, with the .ibd file now ballooned to 43GB, despite hardly anyone editing any pads. Something is clearly wrong and we are in a difficult situation trying to keep it going. Is there any known way to clean/reduce the number of rows in the table? We would be OK losing the history of many or all of the pads, but I cannot understand how the key-value system works to determine the latest revisions.

Thanks!

matthias4217 commented 2 years ago

I have noticed that Etherpad seems to be continually adding new sessions to the database. This may be solved in 1.9 according to the changelog. As for now, you could make a script to clean the sessions in the database, which should hopefully free up some space.

cenotaph commented 2 years ago

Any guidance on this? It seems impossible to tell what any of these key-value pairs mean, what is a session, what is an edit, etc? Thanks.

webzwo0i commented 2 years ago

It really depends. First you should check if running something like optimize table helps: https://dev.mysql.com/doc/refman/8.0/en/optimize-table.html

Do you have any plugins enabled? Plugins like ep_image_upload can cause additional data to be stored in the db.

The sessionstorage: prefixes contain the data that can be deleted. Make sure you do a backup first.

JohnMcLear commented 1 year ago

Should be fixed in 1.9.0, see how you get on.