Project Cache (System information)
The Project Cache tab helps administrators monitor project cache usage and identify projects that may affect P4 Code Review performance.
P4 Code Review stores project data in a Redis cache to improve performance and reduce requests to the P4 Server. Large projects, particularly those with large numbers of branch paths, can consume significant cache space and increase the amount of data transferred each time a project is accessed.
The Project Cache tab displays project cache statistics, highlights projects that exceed configured thresholds, and helps administrators identify opportunities to reduce cache usage and therefore speed up P4 Code Review.
The default thresholds are 8 MB per project cache value and 10,000 branch paths. These values can be changed in the config.php file. Also by default, projects that exceed the configured thresholds can still be saved (this is to reduce disruption to users).
Access to the Project Cache tab is restricted to P4 Code Review administrators.
Why project size matters
Projects with large numbers of branch paths consume more cache space and require more data to be transferred when accessed.
For example, a single wildcard path //depot/component/... can represent the same depot structure as many individually enumerated paths.
Using wildcard paths where appropriate can significantly reduce project cache size and improve performance.
For ways to reduce a project size, see Reduce project cache usage.
Understand project cache information
The Project Cache tab provides information about project cache thresholds, project cache usage, and projects that may require attention.
Warning thresholds
The warning thresholds are displayed at the top of the tab and indicate the currently configured limits for:
-
Project cache size (8 MB by default).
-
Branch path count (10,000 by default).
Example of this warning:
Warning thresholds: 8.0 MB per project value, 10000 branch paths. Edits over a limit are allowed.
Projects that exceed either threshold are flagged in the Project Cache table with a relevant status, such as Over size limit or Over path limit. When a project exceeds a configured threshold, P4 Code Review also writes a warning message to the log. The warning identifies the project and the threshold that was exceeded. This can help administrators identify oversized projects even if they do not regularly review the Project Cache tab.
These limits are configured in the config.php file. To learn more, see Projects.
By default, projects can still be saved when they exceed the configured thresholds. This is indicated by the message Edits over a limit are allowed. This behavior is controlled by the projects.reject_oversized setting. When enabled, projects that exceed the configured limits cannot be saved, and the message changes to Edits over a limit are refused (projects.reject_oversized is on).
Project summary
The summary section provides a quick overview of project cache usage across the P4 Code Review instance.
The summary displays:
-
The total number of recorded projects.
-
The number of projects that exceed configured thresholds.
-
The number of projects exceeding both thresholds.
-
The number of projects exceeding only the cache size threshold.
-
The number of projects exceeding only the branch path threshold.
Example of this summary:
700 projects recorded. 63 projects are over a limit: 4 over both, 9 over size only, 50 over paths only.
Refresh project information
Click Refresh to reload the currently displayed project cache information.
Refreshing updates the displayed data but does not recalculate project statistics. This is expected behavior. Statistics are updated when projects are saved or when the project cache is rebuilt.
Project Cache table
The Project Cache table displays information about individual projects.
-
Project- This is the project name. If the project name differs from the project identifier, the identifier is displayed below the project name. The project identifier is used in URLs and log messages.
-
Cached size - Displays the amount of cache storage used by the project's cached data. If project cache compression is enabled, the displayed value represents the compressed size stored in Redis.
-
Branches - The number of branches configured for the project. A large number of branches is not necessarily a performance concern.
-
Branch paths - The total number of branch paths across all project branches. Projects with very large branch path counts can significantly increase cache usage and affect project cache performance.
-
Recorded - Displays when the project statistics were last recorded. The value is displayed as a relative time, such as:
2 hours ago -
Status - Displays the project's threshold status. Possible values include:
-
OK
-
Over size limit
-
Over path limit
-
Over size limit, Over path limit
Projects that exceed one or more thresholds are highlighted to make them easier to identify.
-
Project ranking
Projects are displayed in order of potential impact. Projects that exceed configured thresholds are listed before projects that are within configured limits, helping administrators identify projects that may require attention.
Projects that exceed both thresholds are displayed before projects that exceed a single threshold.
Reduce project cache usage
If a project exceeds configured thresholds, consider:
-
Replacing enumerated paths with wildcard paths.
-
Removing unused branches.
-
Splitting large projects into multiple projects.
-
Enabling project cache compression.
-
Enabling host-wide project caching.
To learn more about project path configuration, see Projects.
===========================
Add to admin-systeminfo-configuration.htm
Project Cache: View project cache statistics, identify oversized projects, and monitor project cache usage.
===========================
Add to admin.projects.htm
Monitor project cache usage
P4 Code Review maintains project information in Redis to improve performance. Large projects, particularly projects with large numbers of branch paths, can consume significantly more cache storage than other projects.
Use the Project Cache tab in System Information > Configuration to review project cache usage, identify oversized projects, and monitor the impact of project configuration changes on Redis cache usage.
For more information, see Project Cache (System information).
Limit oversized projects
Large projects with excessive numbers of branch paths can increase Redis cache usage and impact performance. P4 Code Review can monitor oversized projects, warn when projects exceed configured thresholds, and optionally prevent users from saving projects that exceed those limits.
Where possible, use wildcard paths such as //depot/component/... instead of large numbers of enumerated paths. Using wildcard paths can significantly reduce project cache size.
Configure oversized project thresholds
Add or update:
'projects' => array(
'max_cache_value_size' => '8M',
'max_branch_paths' => 10000,
'reject_oversized' => false,
),
Where:
-
max_cache_value_size: The maximum allowed project cache size. Projects that exceed this value are flagged as Over size limit. Set to0to disable this threshold. -
max_branch_paths: The maximum allowed number of branch paths in a project. Projects that exceed this value are flagged as Over path limit. Set to0to disable this threshold. -
reject_oversized: Controls whether edits that exceed either threshold are blocked. Defaults tofalse.
The size and branch path thresholds are independent. A project can exceed one threshold, both thresholds, or neither threshold.
Prevent oversized projects
When 'reject_oversized' => true, P4 Code Review refuses project changes that would cause a project to exceed either threshold.
We recommend leaving this setting disabled until any existing oversized projects have been reviewed and corrected.
Monitor oversized projects
Use the Project Cache tab in System Information > Configuration to:
-
Review project cache usage.
-
Identify oversized projects.
-
Monitor branch path counts.
-
Review projects that exceed configured thresholds.
When a project exceeds a configured threshold, P4 Code Review records a warning message in the log and flags the project in the Project Cache tab.
For more information, see Project Cache (System information).
===========================
Add to what's new
Project cache monitoring and Redis performance enhancements
Added a new Project Cache section to the System Information that provides visibility into project cache usage, oversized projects, and Redis storage consumption. Additional Redis configuration options have also been added to improve cache performance, reduce Redis load, and support large-scale deployments. To learn more, see Project Cache (System information).