Perforce Public Knowledge Base - Maximizing P4V Performance
Reset Search
 

 

Article

Maximizing P4V Performance

« Go Back

Information

 
Problem

How do I make P4V run more faster?


Solution

To obtain the best performance from P4V, observe the following guidelines and suggestions:

  • Limit P4V from polling the server:
    P4V checks the Perforce server less frequently, which also reduces the load on the server.

    Note: This P4V variable can be controlled from the server using the p4 property command described in Storing Property Settings in Perforce.

    Note: If set to never check for updates, users need to manually refresh P4V by selecting the "View | Refresh All" menu item.
    1. Select the "Preferences..." menu item in P4V.
    2. Select the "Connection" tab. ("Server Data" in P4V 2012.1 and greater)
    3. Set the "Check server for updates every NNN of minutes" field to a higher number or zero (to never check for updates).
    4. Click "OK" to close the Preferences window.
  • Modify configurables

    Tune net.tcpsize and filesys.bufsize by setting these to 2MB in your P4CONFIG file.

Add the following lines to your P4CONFIG file

filesys.bufsize=2M
net.tcpsize=2M


For example, to set P4CONFIG on Windows, you would run

p4 set -s
p4 set -s P4CONFIG=p4config.txt


then create a p4config.txt file containing the above tunables and place this file into your client workspace root.

One way to modify the configurables is to start P4V from a command prompt where a P4CONFIG file is in the same directory as P4V as seen in this blog.

Alternatively on Windows, run P4V, Edit, Preferences, Connections and check "Open the connection specified by your Perforce environment settings"; then create a P4V desktop icon, right-click Properties, fill in your client workspace root in "Start in:".  You can see the increase in the usage line and himarks lines after running a "p4 sync -f" several times.  For example,

Default:
Perforce server info:
        2014/10/15 11:17:16 pid 11380 bruno@myclient 10.20.145.51 [P4V/NTX86/2014.1/888424/v76] 'user-sync -f //depot/main/release1/perl_proj/7.2-RELEASE-i386-disc1.iso#head'
--- lapse 13.4s
--- usage 182+438us 0+24io 0+0net 3144k 0pf
--- rpc msgs/size in+out 2+134592/0mb+533mb himarks 93749300/64836 snd/rcv 9.06s/.000s
--- db.counters

filesys.bufsize and net.tcpsize set:
Perforce server info:
        2014/10/15 11:19:15 pid 11421 bruno@myclient 10.20.145.51 [P4V/NTX86/2014.1/888424/v76] 'user-sync -f //depot/main/release1/perl_proj/7.2-RELEASE-i386-disc1.iso#head'
--- lapse 13.2s
--- usage 75+233us 0+24io 0+0net 6096k 0pf
--- rpc msgs/size in+out 2+134592/0mb+533mb himarks 93749300/2096452 snd/rcv 12.9s/.004


See Perforce Tunables from our performance lab.  From this paper, the P4CONFIG tunable also can be used with the Perforce server, the Perforce Command-Line Client, the Perforce Proxy, the Perforce Web client (P4Web), the P4FTP plugin, and the Perforce C/C++ API.
  • Limit the maximum number of files displayed per changelist:
    Lowering the default value of "1000" reduces the amount of information P4V has to retrieve from the server for each file in the changelist.
    1. Select the "Preferences..." menu item in P4V.
    2. Select the "Connection" tab. ("Server Data" in P4V 2012.1 and greater)
    3. Set the "Maximum number of files displayed per changelist" field to a lower number.
    4. Click "OK" to close the Preferences window.
Note: This P4V variable can be controlled from the server using the p4 property command.
  • Disable "Show integration history in Time-lapse View by default":
    If you have large branches with a lot of revisions, turning the integration history off limits the number of times P4V has to poll the server.
    1. Select the "Preferences..." menu item in P4V.
    2. Select the "General" tab. ("Tools" in P4V 2012.1 and greater)
    3. Clear the "Show integration history in Time-lapse View by default" checkbox.
    4. Click "OK" to close the Preferences window.
  • Disable "Use a distinct file icon for modified files":
    P4V uses a hash algorithm to compare the workspace file with the file originally retrieved from the server. These comparisons can degrade P4V's performance if you have a large number of files opened for edit.
    1. Select the "Preferences..." menu item in P4V.
    2. Select the "General" tab. ("Files" in P4V 2012.1 and greater)
    3. Clear the "Use a distinct file icon for modified files" checkbox.
    4. Click "OK" to close the Preferences window.
  • Avoid mapping remote depots to workspaces:
    Syncing files from a remote depot is far slower than working with local depots. A better approach is to have an administrator integrate files from a remote depot into a local branch and sync from there.
     
  • Limit the number of items retrieved from the server:
    If the Perforce server contains a large number of jobs, changelists, branches, or labels, reducing the number of these items that the server fetches at a time from the default (1000) improves performance.

    Note: This value only applies to jobs and changes when using P4V with Perforce server versions 2005.2 and earlier.
    1. Select the "Preferences..." menu item in P4V.
    2. Select the "Connection" tab. ("Server Data" in P4V 2012.1 and greater)
    3. Set the "Number of changelist and job entries to fetch at a time" field to a lower number.
    4. Click "OK" to close the Preferences window.
Note: These P4V variable can be controlled from the server using the p4 property command.
  • Implement MaxScanRows, MaxResults, MaxLockTime:
    The Perforce superuser on your system can configure the Perforce server to limit the amount of data on which a single command can operate by assigning users to groups and setting the MaxResults, MaxScanRows, and MaxLockTime parameters for the groups.  For details, refer to the Perforce System Administrator's Guide and Maximizing Perforce Performance.
     
  • Break file retrievals into smaller operations
    Even if an administrator sets the MaxResults, MaxScanRows, or MaxLockTime settings as mentioned above, this does not impede users running P4V if they avoid performing "Get Revision" operations on directories that contain a large number of files. Instead, break a single large "Get Revision" operation into several, each with fewer files to use less memory.
  • Use tighter client workspace views:
    Each client workspace view should access small portions of the depot. Create several client workspaces if needed. See Using Tight Views in the Perforce System Admistrator's Guide.
     
  • Hide deleted depot files:
    Sometimes narrower client workspace views are not feasible. A large site with a large number of files in its depot, numerous users, and numerous workspace specifications might require wider views. The following P4V settings are recommended for the best performance and minimum impact on the Perforce server:
    • Select the "Hide Deleted Depot Files" option in the "View | Filter Depot" menu. If your site has a large number of deleted files, this reduces the number of depot files the P4V client has to display and can result in enhanced performance.
       
    • Do not view the entire depot tree. Select the "Tree restricted to workspace view" option in the "View | Filter Depot" menu.
       
  • Avoid DNS lookups:
    If using an IP address instead of a host name on the command line appears noticably faster, you might be having performance problems related to using a DNS server. If these problems cannot be resolved, you can gain performance while starting P4V by specifying an IP address instead of a node name in the "Server" field of the "Open Connection" dialog.  You may want to place an IP address and your host name into the etc/hosts file on your Unix, Mac, or Windows workstation.
  • Close the P4V Dashboard:
    The P4V Dashboard displays handy information, but incurs an overhead.
     
  • Do not restore the workspace and depot tree states when opening connections
    This will reduce the number of "fstat" commands to the server, freeing up server resource for other commands. This can be done by setting the  "Don't expand Workspace and Depot trees to their previous state when opening connections" options under P4V's preferences -> Connections.
  • Cancel an operation:
    If you inadvertently start a long-running operation, you can cancel it by clicking the cancel button in the P4V toolbar.
     
  • Work around Linux 2.6 kernel limitations
    Due to changes in the way TCP window scaling was implemented within the Linux 2.6 kernel and exemplified from 2.6.17+, adding the following lines to /etc/sysctl.conf, might improve performance when using P4V on Linux:
net.ipv4.tcp_wmem = 4096 32768 131072
net.ipv4.tcp_rmem = 4096 87380 174760
net.ipv4.tcp_window_scaling = 0
Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255