Skip to main content
All CollectionsUsing PerforceTroubleshooting
Speed Up Your Perforce Repo with P4V
Speed Up Your Perforce Repo with P4V
Toshi Dávila avatar
Written by Toshi Dávila
Updated over a month ago

To obtain the best performance from P4V, refer to the following guidelines and suggestions.

Limiting P4V from polling the server

P4V checks the Perforce server less frequently, which also reduces the load on the server.

Note: You can control this P4V variable from the server using the p4 property command.

Note: If P4V is set to never check for updates, users need to manually refresh P4V using the following steps:

  1. Select View > Refresh All from the menu.

  2. Select the Preferences menu item in P4V.

  3. Select the Connection tab. (Server Data tab in P4V 2012.1 and greater.

  4. Set Check server for updates every NNN of minutes to a higher number or zero (to never check for updates).

  5. Click OK.

Modifying 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, run:

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

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

Alternatively on Windows:

  1. Run P4V.

  2. Click Edit > Preferences > Connections.

  3. Check Open the connection specified by your Perforce environment settings.

  4. Create a P4V desktop icon and right-clicking Properties, and filling 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:  
    2024/10/15 11:17:16 pid 11380 bruno@myclient 10.20.145.51[P4V/NTX86/2024.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:
    ​ 2024/10/15 11:19:15 pid 11421 bruno@myclient 10.20.145.51  [P4V/NTX86/2024.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 

Limiting the maximum number of files displayed per changelist

Lowering the default number of files displayed value of 1000 reduces the amount of information P4V has to retrieve from the server for each file in the changelist.

  1. In P4V, select the Preferences menu item.

  2. Select the Connection tab. (Server Data in P4V 2012.1 and greater).

  3. Set the Maximum number of files displayed per changelist to a lower number.

  4. Click OK.

Disabling 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. In P4V, select the Preferences menu item.

  2. Select the General tab. (Tools in P4V 2012.1 and greater).

  3. Clear the Show integration history in Time-lapse View by default box.

  4. Click OK.

Avoiding 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.

Hiding 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 Tree restricted to workspace view in the View > Filter Depot menu item.

Tuning the Linux Kernel for Higher TCP Throughput

In order to tune the networking stack on a Linux system for maximum performance and compatibility with repos running on Assembla, add the following lines to /etc/sysctl.conf  or a custom conf file in /etc/sysctl.d/  (if this path is present and referenced by /etc/sysctl.conf ), and then run 'sudo sysctl -p'  to load in the new sysctl settings.          

net.core.rmem_default = 2796203
net.core.wmem_default = 2796203
net.core.rmem_max = 22369621  
net.core.wmem_max = 22369621  
net.ipv4.tcp_rmem = 4096        2796203 22369621                                              
net.ipv4.tcp_wmem = 4096        2796203 22369621           

You can confirm that the values of each setting were updated by running the following commands:                 

cat /proc/sys/net/core/rmem_default
cat /proc/sys/net/core/wmem_default
cat /proc/sys/net/core/rmem_max
cat /proc/sys/net/core/wmem_max
cat /proc/sys/net/ipv4/tcp_rmem
cat /proc/sys/net/ipv4/tcp_wmem   


Need help? Contact us at support@assembla.com

Did this answer your question?