Save disk space
All files versioned by Helix Core Server reside in subdirectories beneath the root directory, P4ROOT
. The database files, and (by default) the checkpoints and journals, also reside in subdirectories beneath the server root.
Use the p4 diskspace
and p4 sizes
commands to monitor the amount of disk space
currently consumed by your entire installation, or by selected portions
of your installation. See
Monitor disk space usage.
If you are running low on disk space, consider the following approaches to limit disk space usage.
Archive or rebalance
If you have large binary files that are no longer accessed
frequently, consider creating an archive depot and using the
p4 archive
command to transfer these files to bulk,
near-line, or off-line storage. See
Reclaim disk space by archiving files.
If your installation’s database files have grown to more than ten times the size of a checkpoint, you might be able to reduce the size of the files by re-creating them from a checkpoint. See Checkpoints for database tree rebalancing.
Separate physical disks
Moving checkpoints to separate drives is good practice because:
- it conserves disk space
- old checkpoints are needed when recovering from a hardware failure, and if your checkpoint and journal files reside on the same disk as your depot, a hardware failure could make it impossible to restore your database.
Configure
the server
to store the journal file on a separate physical disk. Use the
P4JOURNAL
environment variable or p4d
-J
to specify the location of the journal file. (To learn about p4d, see Helix Core Server (p4d) Reference in the Helix Core Server Administrator Guide.)
Keep the journal file short by taking checkpoints on a daily basis.
Compress checkpoints, or use the -z
option with
p4d
to compress checkpoints on the command line.
Checkpoint location
Use the -jc
prefix
option with the
p4d
command to write the checkpoint to a different
disk.
Alternatively, use the default checkpoint files, but back up your checkpoints to a different drive and then delete the copied checkpoints from the root directory.
The prefix
location can be set using the journalPrefix configurable so prefix
does not have to be specified when running p4d -jc
or p4 admin checkpoint
. Setting journalPrefix
is generally good practice and is strongly recommended where this server acts as a master server The innermost Helix Core server in a multi-server topology. A commit server can also be referred to as a master server. for replicas A Helix Core Server that automatically maintains a full or partial copy of the master server's metadata and that might contain related file content. The replica copies from its master by using 'p4 pull' or 'p4 journalcopy'. A replica can be used as a backup server for disaster recovery..
Symbolic links
You can use symbolic links to point to targets whose paths are on other disks. Helix Core Server supports symbolic links on Linux, macOS, and UNIX, but not on Windows because the Windows implementation is not POSIX-compliant.
To create a symbolic link
-
Stop the Helix Core Server.
-
Run the command that creates the symbolic link.
-
Start the server.