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 4 years ago

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.Select the "Preferences..." menu item in P4V.Select the "Connection" tab. ("Server Data" in P4V 2012.1 and greater)Set the "Check server for updates every NNN of minutes" field to a higher number or zero (to never check for updates).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.

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 

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. Select the "Preferences..." menu item in P4V. Select the "Connection" tab. ("Server Data" in P4V 2012.1 and greater) Set the "Maximum number of files displayed per changelist" field to a lower number. Click "OK" to close the Preferences window.

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. Select the "Preferences..." menu item in P4V. Select the "General" tab. ("Tools" in P4V 2012.1 and greater) Clear the "Show integration history in Time-lapse View by default" checkbox. 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.

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.

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?