6.1. Creating a RepositoryThe repository root directory and the administrative files should be owned by a user made specifically for CVS; typically, the user is named cvs. This system reduces the damage a malicious or careless user can do to the repository, as long as she doesn't have root (superuser) access. To create a repository, create the directory that you want to use as the repository root directory on the computer that will act as the CVS server and ensure that the repository root directory is owned by the user who will ultimately own the repository. A recommended repository root directory is /var/lib/cvsroot. Execute the command cvs -d repository_root_directory init, where repository_root_directory is the name of your directory: this command sets up that directory as a CVS repository. The root directory given must be an absolute path, not a relative path. Example 2-5 (in Chapter 2) shows repository creation. The cvs init command sets up the directory as a CVS repository by creating the CVSROOT subdirectory and the initial files for CVSROOT, with their default configurations. A repository may hold many projects, so to determine how much space you need to allow for your repository, you need to calculate the space for each project. The repository itself will have a small amount of overhead: I allow 500 K for a small repository, and a megabyte or two for most commercial repositories. For any project, ensure enough room on the partition for three times the expected final size of the project. If you intend to store binary files, multiply their expected size by at least five. Monitor the repository's partition; your users may have a use pattern that requires more or less space than this. For most projects, the amount of RAM on the repository server is not an issue. CVS is usually modest in its memory requirements, and a server with 256 MB of RAM can handle most repositories. The two major areas of memory use are large checkouts and large diffs. For each checkout request from a client, CVS spawns two processes. The smaller process uses a negligible amount of memory, but the larger consumes at least 2 MB and can grow to just over the size of the files in the directory being checked out. Fortunately, the larger process can use swap space rather than physical memory. Allow enough memory for several of these processes to run simultaneously, and base your calculations on the project directory that occupies the most disk space. The diff process can also use swap space and runs at each commit. For efficient processing, allow enough swap space or physical memory to store ten times the size of the largest file you expect to commit. If memory is a problem, allow five times the size of the largest file. The diff process is fairly fast, so there is rarely need to allow for simultaneous processes. The repository is user data, and it should be on a partition that is backed up and that won't shut down the machine if it is filled. I recommend /var/lib/, as it is the most appropriate in the Filesystem Hierarchy Standard. Ensure that the repository is on a machine accessible to everyone who needs to use the repository. The repository can be local to a user, or it can be accessed remotely across a network. Remote access methods are explained in Chapter 8. |