Limiting simultaneous connections

If monitoring is enabled (p4 configure set monitor=1 or higher), you can set the server.maxcommands configurable to limit the number of simultaneous command requests that the service will attempt to handle.

Ideally, this value should be set low enough to detect a runaway script or denial of service attack before the underlying hardware resources are exhausted, yet high enough to maintain a substantial margin of safety between the typical average number of connections and your site’s peak activity.

If P4LOG is set, the server log contain lines of the form:

Server is now using nnn active threads.
Tip

You can use the server log to determine what levels of activity are typical for your site. Set server.maxcommands to a value higher than your anticipated peak activity. We recommend at least 200% to 500% higher.

Too many commands

Starting in 2019.1, if a problem occurs with server.maxcommands, users who are super or operator (see User types can still run commands to diagnose the problem.

Even if end-users see the TooManyCommands error, a user who is super can still run the following commands:

p4 admin p4 configure p4 counter
p4 counters p4 group p4 groups
p4 help p4 help-graph (graph) p4 info
p4 journals p4 lockstat p4 login
p4 login2 p4 logout p4 logtail
p4 monitor p4 protect p4 protects
p4 pull p4 server p4 servers
p4 user    

and a user who is operator, such as the administrator of an edge server, can still run the following commands:

p4 admin p4 configure p4 counter
p4 counters    
    p4 info
  p4 lockstat p4 login
  p4 logout p4 logtail
p4 monitor p4 protect  
p4 pull   p4 servers
p4 user