Saved‑objects cache enabled or disabled for Kibana dashboard latency under concurrent load?
0 reputation · 04 Feb 2022, 15:10 UTC
0 reputation · 04 Feb 2022, 15:10 UTC
Goal: Determine whether to enable Kibana’s saved‑objects cache to reduce latency under concurrent dashboard loads while accepting possible metadata staleness, or to disable the cache to guarantee up‑to‑date saved objects at the cost of higher response times.
Constraints: With the cache enabled (xpack.security.savedObjects.enabled: true) lookup latency drops, keeping 95th‑percentile response below ~500 ms for up to 200 concurrent users, but changes to saved objects are not visible until the cache expires (default 5 minutes). Disabling the cache forces each request to read the .kibana index, which can push the same metric above 1.2 s under the same load, especially when the index is large or the cluster is busy. The cache TTL requires a Kibana restart and applies uniformly across all spaces, so fine‑grained per‑space tuning is not available, and the exact numbers vary with Kibana version, ES cluster size, and network conditions.
Should the saved‑objects cache be enabled to keep 95th‑percentile latency under 500 ms for up to 200 concurrent users, accepting a maximum staleness of 5 minutes? Is there a way to mitigate staleness without sacrificing the latency benefit, such as per‑space TTL or automatic cache invalidation when a saved object is modified?
34775 reputation · 04 Feb 2022, 16:59 UTC
Yes, you should enable the saved-objects cache to maintain a 95th-percentile latency under 500ms for 200 concurrent users. In high-concurrency environments, the overhead of repeated lookups against the .kibana index creates a bottleneck that typically outweighs the risk of 5-minute metadata staleness.
The saved-objects cache functions as an in-memory LRU (Least Recently Used) store. When enabled, Kibana retrieves dashboard definitions and visualization metadata from memory rather than executing a query against Elasticsearch for every request. Under concurrent load, this prevents "query storms" on the .kibana index, which is often a shared resource across all Kibana spaces.
There is currently no native mechanism for per-space TTL or automatic, granular cache invalidation triggered by object modification. To mitigate staleness without sacrificing performance, consider these operational strategies:
To validate the impact on your specific cluster size and index volume, perform the following scoped checks:
xpack.security.savedObjects.enabled: false._nodes/stats or Monitoring tab to verify a decrease in request volume to the .kibana index during the cached run.Diagnostic Question: Are the dashboards being accessed by these 200 users largely the same set of shared dashboards, or is each user accessing a unique, personalized dashboard?
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 04 Feb 2022, 19:25 UTC
Depending on your Kibana version, the saved‑objects cache may be invalidated automatically when a saved object is written via the Saved Objects API; this write‑through path purges the specific entry without waiting for the TTL, leaving the rest of the cache warm. You can confirm whether your build includes this behavior by reviewing the release notes for your release or by checking the saved_objects_cache_hits and saved_objects_cache_misses metrics exposed through the Monitoring API (GET /api/monitoring?...).