# Cache cleaner in hot threads

**URL:** <https://discuss.elastic.co/t/cache-cleaner-in-hot-threads/17084>\
**Category:** Elasticsearch\
**Created:** [April 18, 2014, 6:26pm UTC](https://discuss.elastic.co/t/cache-cleaner-in-hot-threads/17084 "2014-04-18T18:26:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [April 18, 2014, 6:26pm UTC](https://discuss.elastic.co/t/cache-cleaner-in-hot-threads/17084/1 "2014-04-18T18:26:09Z")

</div>

I'm still doing performance work and I keep seeing the CacheCleaner pop up  
[1]. I don't know how much of an effect its actually having, but I imagine  
its something.

It looks like entries in the cache get queued for deletion both by cache  
clear commands and by readers closing. Would it make sense to forgo  
removing entries when the readers close and let the LRU policy clean it up?

Nik

[1]:  
100.4% (502.1ms out of 500ms) cpu usage by thread  
'elasticsearch[elastic1001][generic][T#73]'  
2/10 snapshots sharing following 5 elements

org.elasticsearch.common.cache.LocalCache$HashIterator.remove(LocalCache.java:4353)

org.elasticsearch.indices.cache.filter.IndicesFilterCache$ReaderCleaner$1.run(IndicesFilterCache.java:186)

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
java.lang.Thread.run(Thread.java:724)  
4/10 snapshots sharing following 8 elements

org.elasticsearch.common.cache.LocalCache$HashIterator.nextInTable(LocalCache.java:4306)

org.elasticsearch.common.cache.LocalCache$HashIterator.advance(LocalCache.java:4271)

org.elasticsearch.common.cache.LocalCache$HashIterator.nextEntry(LocalCache.java:4346)

org.elasticsearch.common.cache.LocalCache$KeyIterator.next(LocalCache.java:4362)

org.elasticsearch.indices.cache.filter.IndicesFilterCache$ReaderCleaner$1.run(IndicesFilterCache.java:183)

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
java.lang.Thread.run(Thread.java:724)  
4/10 snapshots sharing following 7 elements

org.elasticsearch.common.cache.LocalCache$HashIterator.advance(LocalCache.java:4271)

org.elasticsearch.common.cache.LocalCache$HashIterator.nextEntry(LocalCache.java:4346)

org.elasticsearch.common.cache.LocalCache$KeyIterator.next(LocalCache.java:4362)

org.elasticsearch.indices.cache.filter.IndicesFilterCache$ReaderCleaner$1.run(IndicesFilterCache.java:183)

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
java.lang.Thread.run(Thread.java:724)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0p8QT5LadzeoinXJdQTyDzNrcaua95UON8zjVaY%3D1cMg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0p8QT5LadzeoinXJdQTyDzNrcaua95UON8zjVaY%3D1cMg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Gabriel\_Kastenbaum](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gabriel_kastenbaum/32/1628_2.png) [@Gabriel\_Kastenbaum](https://discuss.elastic.co/u/Gabriel_Kastenbaum)\
**Post date:** [April 20, 2014, 11:40pm UTC](https://discuss.elastic.co/t/cache-cleaner-in-hot-threads/17084/2 "2014-04-20T23:40:17Z")

</div>

I have the same issue. The configuration is : Two nodes, we sent them some  
data (1m) and now they are running at 200%/400% around

org.elasticsearch.indices.cache.filter.IndicesFilterCache$ReaderCleaner$1.run(IndicesFilterCache.java:183)  
for hours. (ES version 1.0.1)

Le vendredi 18 avril 2014 20:26:09 UTC+2, Nikolas Everett a écrit :

> I'm still doing performance work and I keep seeing the CacheCleaner pop up  
> [1]. I don't know how much of an effect its actually having, but I imagine  
> its something.
> 
> It looks like entries in the cache get queued for deletion both by cache  
> clear commands and by readers closing. Would it make sense to forgo  
> removing entries when the readers close and let the LRU policy clean it up?
> 
> Nik
> 
> [1]:  
> 100.4% (502.1ms out of 500ms) cpu usage by thread  
> 'elasticsearch[elastic1001][generic][T#73]'  
> 2/10 snapshots sharing following 5 elements
> 
> org.elasticsearch.common.cache.LocalCache$HashIterator.remove(LocalCache.java:4353)
> 
> org.elasticsearch.indices.cache.filter.IndicesFilterCache$ReaderCleaner$1.run(IndicesFilterCache.java:186)
> 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> java.lang.Thread.run(Thread.java:724)  
> 4/10 snapshots sharing following 8 elements
> 
> org.elasticsearch.common.cache.LocalCache$HashIterator.nextInTable(LocalCache.java:4306)
> 
> org.elasticsearch.common.cache.LocalCache$HashIterator.advance(LocalCache.java:4271)
> 
> org.elasticsearch.common.cache.LocalCache$HashIterator.nextEntry(LocalCache.java:4346)
> 
> org.elasticsearch.common.cache.LocalCache$KeyIterator.next(LocalCache.java:4362)
> 
> org.elasticsearch.indices.cache.filter.IndicesFilterCache$ReaderCleaner$1.run(IndicesFilterCache.java:183)
> 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> java.lang.Thread.run(Thread.java:724)  
> 4/10 snapshots sharing following 7 elements
> 
> org.elasticsearch.common.cache.LocalCache$HashIterator.advance(LocalCache.java:4271)
> 
> org.elasticsearch.common.cache.LocalCache$HashIterator.nextEntry(LocalCache.java:4346)
> 
> org.elasticsearch.common.cache.LocalCache$KeyIterator.next(LocalCache.java:4362)
> 
> org.elasticsearch.indices.cache.filter.IndicesFilterCache$ReaderCleaner$1.run(IndicesFilterCache.java:183)
> 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> java.lang.Thread.run(Thread.java:724)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/76076d38-e928-4eae-aa04-aff92e5c8983%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/76076d38-e928-4eae-aa04-aff92e5c8983%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:34am UTC](https://discuss.elastic.co/t/cache-cleaner-in-hot-threads/17084/3 "2017-07-06T01:34:44Z")

</div>


