Perforce Public Knowledge Base - Use of P4Broker in Distributed Perforce environment
Downloads Blog Company Integrations Careers Contact Try Free
Menu Search
Reset Search



Use of P4Broker in Distributed Perforce environment

« Go Back


Where can I deploy and use P4Broker in a Distributed Perforce environment?

Distributed Architecture

There are a great many ways on how you can design and deploy a Distributed Perforce environment.  In the simplest setup, you would have one Commit Server and a couple of Edge Servers. Depending on the needs of each site, you can optionally deploy different type of replicas in different locations. You can refer to this article to decide on what to use.  Last not the least, you can still use P4Proxy and P4Broker as the building blocks of your distributed environment which are easy to setup and proven to work well for their designed purposes.

This article will propose some ideas on how you may deploy the P4Broker in a distributed environment.

Disaster Recovery

In a high availability setup, you are likely to have configured a readonly replica for taking off-checkpoint of your Commit / Edge servers. This readonly replica can then used as act as the standby servers in a Disaster Recovery situation. You can fail-over to these standby servers  as become the active Commit / Edge servers .  You may consider to deploy a Broker to streamline the switch from the old  to the new server where all clients / applications to continue to point to the same P4Broker which in turns point to the active Commit / Edge server as appropriate. 

Refer to this section of Distributing Perforce guide on what you can setup an alternate server.


Load Balancer

If you have more one Edge / Replica servers on a site, you may use P4Broker to distribute and control the traffic to go to  different servers based on the broker configuration. While P4Broker can distribute traffic randomly, you can say  configure it to re-direct all readonly commands to the standby (readonly) server to take off some of the load from the associated Edge / Replica server.

Refer to this article Using P4Broker to redirect read-only commands on how you may implement this.

Routing Traffic

Depending on the setups, an Edge server may only contain filtered data from Commit server. This means each of the Edge servers is responsible for different depot paths or projects. P4Broker can be deployed to route client to different Edge servers transparently where appropriate. You can consider the same if you have different types of replicas in a site.

Refer to this section of Distributing Perforce on how may configure P4Broker.

Performance Consideration

If you have an overloaded server, a P4Broker can add more flexibility and control on how you can distribute the traffic among the servers. However, P4Broker itself represents  an extra layer before a client / application can connect to the server. You have to balance between the added benefits and the associated overhead of a P4Broker, and test it fully in the your environment.

Please contact Technical Support if you want to discuss this further.
Related Links



Was this article helpful?



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

Characters Remaining: 255