When/how often to clean database?

How (often) do you run this command in order to clear expired session records in Seahub database

./seahub.sh clearsessions

Do you use cron?
Can seafile server run while executing this command?

I never clean it though my server has been running over a year. Is it important to clean?

Don’t know. That’s why I’m asking :wink:

It depends on the number of users and visits of your Seafile server. The cleanups are only needed to shrink the database. For small private installations a monthly cleanup is more than enough.

For larger installations I recommend cleaning the table up using SQL because it is way faster (>100x).

1 Like

Do you mean the sql command directly? Without using the script from seafile?

By the way: You can check how big a table gets, i would say as long as the disk space is not the problem, you don’ t have to worry about this (at least on small installations).

Didn’t test it. Should be possible though.

yes

agree, doesn’t harm to clean it up, though :wink: