Repository navigation
Description
Problem Statement
A single POST /api/v1/drive/search request can execute select * from user_ where userid=? between 363 and 1,025 times. Root cause: cache.userdotcmscache.size is commented out in dotmarketing-config.properties, falling back to cache.default.size=1000. A reference instance with 1,828 active users exceeds that capacity, so the cache evicts continuously during normal listing navigation — and each eviction is amplified up to 8x, because the same modUser/owner gets resolved multiple times per row through different code paths (audit properties, version properties, URL building).
Two earlier hypotheses were investigated and ruled out: this is not a classic per-row N+1 access pattern, and it is not missing negative-caching for nonexistent users (zero were found in the test data).
Confirmed empirically: raising the cache size to 4000 dropped lookups per request from an average of ~688 to 1-2.
Decision: ship a larger static default (not auto-computed sizing) — the tested value (4000) resolved the reference instance with margin; auto-sizing was rejected as disproportionate effort for a problem a documented, generous default already resolves in practice.
Steps to Reproduce
- On an instance with more active users than
cache.default.size(1000), list a folder whose content spans many distinct authors, via Content Drive or Site Browser - Observe
user_-by-id query volume viapg_stat_statements
Expected vs Actual
Expected: user lookups converge to a small, stable number after warm-up. Actual: lookups remain in the hundreds indefinitely because the cache never has room to hold the working set.
Acceptance Criteria
- Default
cache.userdotcmscache.sizeraised from the effective 1000 to a documented value with real headroom (reference: 4000 resolved 1828 users) - User-record lookup volume per request drops by at least an order of magnitude on an instance whose user count exceeds the old default
- Returned rows, display names, and fallback labels for missing users are unchanged
- Folder-listing permission-filtering behavior is unchanged for both an administrator and a permission-restricted user
- (Optional, may be descoped if the above alone resolves the bulk of the churn) Redundant same-user resolution within a single row is reduced
Related, out of scope for this issue
Two findings surfaced during investigation, tracked separately if pursued: BrowserAPIImpl transforms all subfolders before paging (wastes owner resolution on discarded subfolders); two filterCollection calls use the non-batch overload where the codebase's own standard prefers batch.
Parent Epic
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Aug 24, 2026
PRs linked to this issue
fix(content-drive): correct ContentletVersionInfo package in test imp…
fix(content-drive): fix two integration test bugs found running Brows…
chore: trigger CI re-run (retry flaky PersonaAPITest/MainSuite 2a for #…
rjvelazco commentedon Sep 16, 2026
QA Passed
dotcms/dotcms:trunk_8f0c9fa]Video
video-qa.mov
#902 include in 25.07.10 LTS: Session handling: deactivating a user d…