p4 configure

Set, view, and manage server configuration variables.

Syntax

p4 [g-opts] configure set [server_id#]variable=value
p4 [g-opts] configure unset [server_id#]variable
p4 [g-opts] configure show [allservers | variable] p4 [g-opts] configure history [allservers | variable]

Description

Note

Although we recommend the syntax above, using p4 serverid instead of P4NAME, the following syntax is still supported.

p4 [g-opts] configure set [P4NAME#]variable=value
p4 [g-opts] configure unset [P4NAME#]variable
p4 [g-opts] configure show [allservers | P4NAME | variable]
p4 [g-opts] configure history [allservers | P4NAME | variable]

Configuration variables are used to control and customize the behavior of the Helix Core service. A configurable setting might affect the client, the server, or a proxy.

Tip

An alternative is using p4 server, which conveniently allows some configuration in the server spec. See the p4 server topic on the DistributedConfig: field.

Important

The configuration variables are described both in this Reference and at the command line:

This Reference Command-line

See Configurables - alphabetical list

(indicates which ones require stopping the server.)

p4 help configurables
See Environment and registry variables p4 help environment
Tip

The super user can use p4 [g-opts] configure history [allservers | P4NAME | variable] to display the history of configurables, which are recorded by the 2019.2 server onwards. See the Options.

Precedence

The following table shows how the value of a configurable variable is set, where 1 overrides 2, 2 overrides 3, and 3 overrides 4:

Precedence

How the value is set

1

Command line "-v" options that are passed at server startup. For example:

$ p4d -v net.keepalive.idle=2700
2

Persistently, using the p4 configure set command.

This method allows you to set the specified configurable for a named server or for any server.

3

Using environment variables.

  • For Windows, use p4 set -S Perforce, such as
    p4 set -S Perforce P4DEBUG="net.keepalive.idle=2700" and the value will persist
  • On Unix, use the export command, which does not persist
Note

Certain server-related configurables are read-only. For example, the p4 configure or p4 configure set commands cannot change the value of the P4ROOT or P4JOURNAL environment variables.

4

Using default values (no action required).

Tip

You can use K and M to represent large numbers. For example, 10M is the default value for the dm.shelve.maxfiles configurable.

Viewing the values of configuration variables on all servers

To display the configuration across all servers, use

p4 configure show allservers

The output might be similar to:

any: lbr.autocompress = 1
any: submit.allowbgtransfer = 1
paris-edge: P4LOG = /home/perforce/servers/edge1/log
headquarters-commit: P4LOG = /home/perforce/servers/commit-hq/log

where any means a configurable defined on the commit server that is used by all connected servers unless specifically overridden in that particular server's configuration.

Viewing the values of configuration variables on one server

To display the configuration state of the current server, a named server, or any configurable, including a Helix Core environment variable, use

p4 configure show

Each configurable is displayed along with its value, where the entry in the parentheses ( ) indicates how the value was set:

If the output line is ... the value was set by ...
P4PORT=20192 (-p) p4d -p
monitor=2 (-v) p4d -v
net.parallel.max: 10 (configure) p4 configure
serverid=commit (serverid) p4 serverid

Note that monitor is set to 2. To find out whether a specific configurable variable has been set in more than one way, specify that configurable variable:

p4 configure show monitor

which might output:

monitor=2 (-v)
monitor=10 (configure)

to indicate that p4d -v set monitor to 2, and p4 configure set monitor to 10. Because p4d has precedence over p4 configure, the output of p4 configure show indicates that monitor is set to 2.

Unsetting a value

To remove a custom setting of a configurable, use the p4 configure unset command.

After installing Helix server, it is good practice to:

  • enable process monitoring by setting monitor to 1 or 2
  • require ticket-based authentication by setting security to 3 or 4
  • prevent the automatic creation of new users by setting dm.user.noautocreate to 1 or 2
  • force new users that you create to reset their passwords by setting dm.user.resetpassword to 1

Stopping the server for some configurables

Changes to most configurables take effect immediately. For example,

Changes to P4AUTH, P4PORT, the startup.N configurables used in replicated environments, net.tcpsize, and net.backlog require a restart. To restart the server, use p4 admin restart.

For certain configurables, such as ssl.tls.version.min:

After you change the value of this configurable, you must explicitly "stop" the server.

Note

p4 admin restart is not sufficient.

For UNIX, see Stopping the Perforce Service and Starting the Perforce Service.

For Windows, see Starting and stopping the Helix server.

Setting configurables in multi-server environments

Servers can be identified by name. In replicated and multi-server environments, a master can control the settings of multiple replicas by specifying the server name as part of the configurable. For example, the following command sets the value of the serviceUser configurable for an edge server (tokyo_edge). The command is executed on the commit server.

$ p4 configure set tokyo_edge#serviceUser=svc_tokyo_edge

See Deployment architecture in the Helix Core Server Administrator Guide.

Accessing configurables when the server is down

If the Helix server is not running or you cannot access the server, you can use the p4d command to list, set, and unset server configurables:

  • To list all server configuration variables, use the -cshow option. For example:

    $ p4d -r $P4ROOT -cshow
  • To set or unset values, use -cset or -cunset. For example:

    $ p4d -r $P4ROOT "-cset myServer#auth.ldap.timeout=30"
    $ p4d -r $P4ROOT "-cunset myServer#db.replication"

For more information, see the Support Knowledgebase article, "Accessing Server Configuration Variables".

Options

set variable=value

Sets the named variable to the provided value.

unset variable

Unsets the named variable.

show

Shows the current configuration of the server currently specified by P4PORT.

Note

Regarding the maximum size of the db.monitor table, see db.monitor.shared configurable, and note that p4 configure show indicates the actual maximum, but p4 configure show allservers indicates a manual preference that is only enforced if sufficient memory is available.

show allservers

Shows the configuration variables for all servers known to the system.

show variable

Shows the setting of the specified configuration variable.

show P4NAME

If a Helix server was invoked with -In P4NAME or with the P4NAME environment variable set to a server name, shows the settings of the named server.

Important

To avoid configuration problems, the value of serverID should always match the value of P4NAME if both are set. We recommend setting serverID instead P4NAME.

history

Records any changes to the value of each configurable in the db.configh table, which contains the name of the configurable, the targeted serverId, the old value, the new value, the user who made the change, the datetime of the change, the configureVersion number, and the serverId on which the change occurred.

history allservers

Shows the history of configuration variables for all servers known to the system.

history variable

Shows the history of the specified configuration variable.

history P4NAME

If a Helix server was invoked with -In P4NAME or with the P4NAME environment variable set to a server name, shows the history of the settings of the named server.

Important

To avoid configuration problems, the value of serverID should always match the value of P4NAME if both are set. We recommend setting serverID instead of P4NAME.

g-opts

See Global options.

Usage Notes

Can File Arguments Use Revision Specifier? Can File Arguments Use Revision Range? Minimal Access Level Required

N/A

N/A

super

Examples

p4 configure set "Replica1#startup.1=pull -i 1"

On the server named Replica1, set the startup.n configurable to poll 1 every second

p4 configure set rpl.labels.global=1

 

The server returns:

For server 'any', configuration variable 'rpl.labels.global' set to '1'

where 'any' means this setting applies to ALL servers, unless there is a local override for the same setting.

Related Commands

The p4 configure command replaces many of the settings formerly set by p4 counter.

To list all counters and their values

p4 counters

To set Helix Core server system variables p4 set