With
the passage of time, considerably increases the disk space used by svn
repository. While the cost of storage has dropped incredibly in the past
few years, disk usage is still a valid concern for administrators
seeking to version large amounts of data so the maintenance activities
about to free disk space becomes necessary. Some of them are:
- Removing dead transactions;
- Purging unused Berkeley DB logfiles;
- Packing FSFS filesystems;
- Purging the svn history.
Removing dead transactions
Though
they are uncommon, there are circumstances in which a Subversion commit
process might fail, leaving behind in the repository the remnants of
the revision-to-be that wasn't an uncommitted transaction and all the
file and directory changes associated with it.
You can use the svnadmin lstxns command to list the names of the currently outstanding transactions and remove them with "svnadmin rmtxns" command.
You can use the svnadmin lstxns command to list the names of the currently outstanding transactions and remove them with "svnadmin rmtxns" command.
Example:
$ svnadmin lstxns myrepos
27
4c3
w33
$ svnadmin rmtxns myrepos `svnadmin lstxns myrepos`
Purging unused Berkeley DB logfiles
Removing unused Berkeley DB logfiles allows you to free disk space. Use the svnadmin list-unused-dblogs command to list the unused logfiles and remove them.Example:
$ svnadmin list-unused-dblogs /var/svn/repos
/var/svn/repos/log.0000000127
/var/svn/repos/log.0000000128
/var/svn/repos/log.0000000129
$ rm `svnadmin list-unused-dblogs /var/svn/repos`
Prune the history
Also you can prune your history. For example: say you have 180 revisions, you can keep the latest history, say 30 revisions. This may also reduce the size of your subversion repository.$ svnadmin dump /path/to/current/repo -r150:180 > newsvn.dump
# you can delete the old repo and then
$ svnadmin create /path/to/new/repo
$ svnadmin load /path/to/new/repo < newsvn.dump
Packing FSFS filesystems
FSFS-backed
Subversion repositories create, by default, a new on-disk file for each
revision added to the repository. Having thousands of these files
present on your Subversion server, even when housed in separate shared
directories, can lead to inefficiencies. To solve this problem, you can
use "svnadmin pack" command. By concatenating all the files of a completed shard into a single “pack”
file and then removing the original per-revision files, svnadmin pack
reduces the file count within a given shard down to just a single file.
In doing so, it aids filesystem caches and reduces (to one) the number
of times a file storage overhead penalty is paid.
Example:
$ svnadmin pack /var/svn/repos
Packing shard 0...done.
Packing shard 1...done.
…
Packing shard 100...done.
A relevant consideration is that the svnadmin pack command has no effect on BDB-backed Subversion repositories.
No comments:
Post a Comment