Index: book/ch05-repository-admin.xml =================================================================== --- book/ch05-repository-admin.xml (revision 3403) +++ book/ch05-repository-admin.xml (working copy) @@ -1004,6 +1004,18 @@ $ svnadmin recover). + + + + FSFS Configuration + + As of Subversion 1.6, FSFS filesystems now contain several + parameters which an adminstrator can configure during run time. These + parameters can be changed while a repository is in use, and may + affect the performance or disk usage of the filesystem. These options + may be found in the db/fsfs.conf file in + the repository. + @@ -1669,6 +1681,61 @@ $ rm `svnadmin list-unused-dblogs /var/svn/repos` + + + Packing FSFS Filesystems + + FSFS-backed Subversion repositories create one file + for each revision. Having thousands of files littering the + filesystem, even when housed in separate directories as part + of shards, can lead to inefficiencies. First, the operating + system has to reference many different files over a short + period of time, which leads to inefficient uses of disk caches + and more time seeking across large disks. + + The second problem is a bit more subtle: each file claims + more space on the disk than it actually uses. Because of the + ways that most filesystem allocate disk space, this amount + can average anywhere from 2 to 16 kilobytes per + revision. The effect is most pronounced in + repositories which have many small revisions, since the overhead + involved in storing the revision quickly outgrows the + actual data being stored. + + To solve these problems, Subversion 1.6 introduced the + svnadmin pack command which reduces the + number of files stored in an FSFS-backed Subversion repository. + It does this by concatenating all the files of a completed + shard into a single "pack" file, along with a manifest recording + the appropriate offsets in the pack file. These are stored + in place of the single revision files as part of the shard. + svnadmin pack does not currently affect + BDB repositories. + + Subversion can pack existing sharded repositories which + have been upgraded to the 1.6 filesystem format (see + ). To do so, + just run svnadmin pack on the repository: + + +$ svnadmin pack repo +Packing shard 0...done. +Packing shard 1...done. +Packing shard 2...done. +Packing shard 3...done. +Packing shard 4...done. +... +Packing shard 36...done. +$ + + + Because the packing process obtains the needed locks before + doing its work, you can run it on live repositories, or even as + part of a post-commit hook. Repacking packed shards is legal, but + will have no effect on the space of the repository. + + +