Sunday, 8 June 2014

Perforce Proxy Server Setup


Perforce Proxy Server Configuration :

System Requirements

* Perforce server: 2002.2 or higher
* Perforce clients: any version, any client program
* OS requirements: sufficient disk space for storing file revisions
 (P4P does not store server metadata)


Starting P4P

To start P4P, you invoke the p4p executable.  For example,
the following command line starts a proxy that communicates
with a central Perforce server located on a host named
'centralserver', listening on port 1666.  Perforce clients
connect to P4P on port 1666 on the machine where the proxy
runs.  P4P file revisions will be stored under a directory
named /local/proxyroot.

        p4p -p 1666 -t centralserver:1666 -r /local/proxyroot

The following command-line flags are supported.

* Proxy-specific options

-c              Do not compress files transmitted from the
               Perforce server to P4P
-d              Run as a daemon (fork first, then run)
-f              Run as single-threaded server
-i              Run for inetd (socket on stdin/stdout)
-q              Suppress startup messages
-s              Run as an NT service (or invoke as p4ps)
-e size Only cache files larger than size bytes
(default $P4PFSIZE or zero)

* General options

-h or -?        Display this message
-L log          File to which messages are logged
               (default $P4LOG, or stderr if $P4LOG is not set)
-p port         Port on which P4P accepts Perforce client requests
               (default $P4PORT or 1666 if $P4PORT is not set)
-r root         Proxy cache directory (default $P4PCACHE or directory
               where p4p is started if $P4PCACHE is not set)
-t port         Port that P4P uses to connect to a server
(default $P4TARGET or perforce:1666 if
$P4PORT is not set)
-v level        Specifies debug mode (see Perforce System
Administrator's guide for details; default
$P4DEBUG or none if $P4DEBUG is not set)
-V              Display the version of the Perforce proxy


Administering P4P

* No backups required

 You do not need to back up the P4P cache directory.
 If necessary, P4P reconstructs it based on Perforce
 server metadata.

* Loading the cache directory to obtain best initial performance

 P4P stores file revisions only when one of its clients
 requests them.  File revisions are not "prefetched." Note
 that the performance gain that is provided by P4P only
 comes into effect after file revisions are cached.  After
 starting P4P, you can load the cache directory by creating
 a client and syncing it to the head revisions, enabling
 other clients that subsequently connect to immediately
 obtain the performance improvements provided by P4P.

* Managing disk space consumption

 P4P saves file revisions in its cache directory.  Note
 that P4P's disk space consumption only increases.  P4P
 does not delete its cache files or otherwise manage its
 consumption of disk space.  To recover disk space, remove
 files under the proxy's root.  It is safe to delete the
 proxy's cache files while the proxy is running.

* Protections

 The p4 protect command can distinguish connections coming
 from a proxy if the string 'proxy-' is prepended to the
 IP addresses of the true client and used in the protections
 table.  For example, 'proxy-*' applies to all connections
 from all proxies and 'proxy-10.0.0.5' identifies a host
 with an IP address of 10.0.0.5 and connecting to p4d
 through a proxy.

* Remote Depots

 The proxy is designed to operate between a p4 client and
 a p4 server (p4d).  It does not work between two p4 servers
 in a remote depot configuration.  Attempting to connect
 to a remote depot via a proxy will result in the proxy
 logging an error about this configuration (i.e. can not
 proxy for remote depots) and an error at the p4 server
 about unable to access remote depot and an error at the
 client.


No comments:

Post a Comment