# Search Profiler in Kibana - Unable to Clear Cached Data

**URL:** https://discuss.elastic.co/t/search-profiler-in-kibana-unable-to-clear-cached-data/302754
**Category:** Kibana
**Created:** [April 20, 2022, 1:12am UTC](https://discuss.elastic.co/t/search-profiler-in-kibana-unable-to-clear-cached-data/302754 "2022-04-20T01:12:15Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![scott\_stash](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@scott\_stash](https://discuss.elastic.co/u/scott_stash)
#### Post date: [April 20, 2022, 1:12am UTC](https://discuss.elastic.co/t/search-profiler-in-kibana-unable-to-clear-cached-data/302754/1 "2022-04-20T01:12:15Z")

</div>

I'm attempting to optimize a query using the Search Profiler in Kibana. I'm having issues as it appears ES keeps caching something so my first query is slow and subsequent ones are quick.

I have attempted the following on the index but it does not appear to help: 'POST /index-name/\_cache/clear'

Is there another step I need?

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [April 20, 2022, 8:18am UTC](https://discuss.elastic.co/t/search-profiler-in-kibana-unable-to-clear-cached-data/302754/2 "2022-04-20T08:18:15Z")

</div>

Hey,

so that is clearing the caches used within the heap of the Elasticsearch JVM. However there are other caches like the Linux Kernel Page Cache, which are not cleared - that cache is responsible to keep that is frequently accessed in the main memory.

--Alex

---

<div class="post-metadata">

### Author: ![scott\_stash](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@scott\_stash](https://discuss.elastic.co/u/scott_stash)
#### Post date: [April 20, 2022, 10:01am UTC](https://discuss.elastic.co/t/search-profiler-in-kibana-unable-to-clear-cached-data/302754/3 "2022-04-20T10:01:28Z")

</div>

I also tried the following, closed the index, and modified the following setting:

```auto
PUT /index-name/_settings
{
  
    "index.queries.cache.enabled" : "false"
}

```

After opening the index I think the queries are still being cached.

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [April 21, 2022, 9:14am UTC](https://discuss.elastic.co/t/search-profiler-in-kibana-unable-to-clear-cached-data/302754/4 "2022-04-21T09:14:13Z")

</div>

What makes you think so? Have you checked the index stats?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 19, 2022, 9:14am UTC](https://discuss.elastic.co/t/search-profiler-in-kibana-unable-to-clear-cached-data/302754/5 "2022-05-19T09:14:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
