Perforce 2002.2 System Administrator's Guide | ||
<< Previous Chapter Perforce and Windows |
Table of Contents Index Perforce on the Web |
Next Chapter >> Perforce Server (p4d) Reference |
To improve performance obtained by multiple Perforce clients accessing a central Perforce server across a WAN, configure P4P on the side of the network close to the clients and configure the clients to access P4P, and then configure P4P to access the central Perforce server. (On a LAN, you can also obtain performance improvements by setting up proxies to divert workload from the central server's CPU and disks.)
The following diagram illustrates a typical P4P configuration:
In this configuration, file revisions requested by users at a remote development site are fetched first from a central Perforce server (p4d running on central) and transferred over a relatively slow WAN. Subsequent requests for that same revision, however, are delivered from the Perforce Proxy, (p4p running on outpost), over the remote development site's LAN, reducing both network traffic across the WAN and CPU load on the central server.
For example, the following command line starts a proxy that communicates with a central Perforce server located on a host named central, listening on port 1666.
p4p -p 1999 -t central:1666 -r /var/proxyroot
To use the proxy, Perforce client programs connect to P4P on port 1999 on the machine where the proxy runs. P4P file revisions are stored under a directory named /var/proxyroot.
The following general options are supported.
If necessary, P4P reconstructs the cache based on Perforce server metadata.
For example, if a Perforce server is running on central:1666 and you direct your Perforce client to a Perforce Proxy running on outpost:1999, the output of p4 info resembles the following:
For instance, consider an organization with a remote development site with workstations on a subnet of 192.168.10.0/24. The organization also has a central office where local development takes place; the central office exists on the 10.0.0.0/8 subnet. A Perforce Server resides on the 10.0.0.0/8 subnet, and a Perforce Proxy resides on the 192.168.10.0/24 subnet. Users at the remote site belong to the group remotedev, and may occasionally visit the central office.
To ensure that members of the remotedev group use the proxy while working at the remote site, but do not use the proxy when visiting the local site, add the following lines to your protections table:
list group remotedev 192.168.10.* -//... |
The first line denies list access to all users in the remotedev group if they attempt to access Perforce without using the proxy from their workstations in the 192.168.10.* subnet. The second line grants write access all users in remotedev if they are using a Perforce Proxy server and are working from the 192.168.10.* subnet. Users of workstations at the remote site must use the proxy.
Similarly, the third and fourth lines deny list access to remotedev users when they attempt to use the proxy from workstations on the central office's subnet (10.0.0.0/8), but grant write access to remotedev users who access the Perforce server directly from workstations on the central office's subnet. When visiting the local site, users from the remotedev group must access the Perforce server directly.
Deploying an additional proxy server on a subnet when network bandwidth on the subnet is nearly saturated will not likely result in a performance improvement. Instead, split the subnet into multiple subnets and deploy a proxy server in each resulting subnet.
In the illustrated configuration, a server room houses a company's Perforce server (p4d), a network storage device (NAS), and a database server (RDBMS). The server room's network segment is saturated due heavy loads placed on it by a sales force constantly querying a database for live updates, and the developers and graphic artists frequently accessing large files through the Perforce server.
By deploying two instances of Perforce Proxy, one on the developers' subnet, and one on the graphic artists' subnet, all three groups benefit from improved performance due to decreased use on the server room's network segment.
After starting P4P, you can effectively prefetch the cache directory by creating a client workspace and syncing it to the head revision. All other clients that subsequently connect to the proxy immediately obtain the performance improvements provided by P4P.
For instance, a development site located in Asia with a P4P server targeting a Perforce server in North America can preload its cache directory by using an automated job that runs a p4 sync against the entire Perforce depot after most work at the North American site had been completed, but before its own developers arrived for work.
For instance, if the P4P cache root is /disk1/proxy and the Perforce server it supports has two depots named //depot and //released, you can split data across disks, storing //depot on disk1 and //released on disk2 as follows:
The symbolic link means that when P4P attempts to cache files in the //released depot to /disk1/proxy/released, the files are stored on /disk2/proxy/released.
To disable compression, specify the -c option when you invoke p4p. This option is particularly effective if you have excess network and disk capacity and are storing large numbers of binary file revisions in the depot, because the proxy (rather than the server) will decompress the binary files from its cache before sending them to Perforce clients.
Perforce 2002.2 System Administrator's Guide | ||
<< Previous Chapter Perforce and Windows |
Table of Contents Index Perforce on the Web |
Next Chapter >> Perforce Server (p4d) Reference |