# How to free up write thread queues

**URL:** https://discuss.elastic.co/t/how-to-free-up-write-thread-queues/364981
**Category:** Elasticsearch
**Created:** [August 15, 2024, 7:16pm UTC](https://discuss.elastic.co/t/how-to-free-up-write-thread-queues/364981 "2024-08-15T19:16:59Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![erikg](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@erikg](https://discuss.elastic.co/u/erikg)
#### Post date: [August 15, 2024, 7:16pm UTC](https://discuss.elastic.co/t/how-to-free-up-write-thread-queues/364981/1 "2024-08-15T19:16:59Z")

</div>

Hello,  
How do we free or flush the threadpool write queue in Elastic?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [August 16, 2024, 6:49am UTC](https://discuss.elastic.co/t/how-to-free-up-write-thread-queues/364981/2 "2024-08-16T06:49:30Z")

</div>

Why do you think you need to do this? Why not just drain it by reducing/stopping indexing into Elasticsearch? Which version of Elasticsearch are you using?

---

<div class="post-metadata">

### Author: ![erikg](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@erikg](https://discuss.elastic.co/u/erikg)
#### Post date: [August 16, 2024, 3:40pm UTC](https://discuss.elastic.co/t/how-to-free-up-write-thread-queues/364981/3 "2024-08-16T15:40:15Z")

</div>

Hello @Christian_Dahlqvist

we ending up doing the latter, we stopped the ingest but wouldn't it be better to flush out the write queue instead of having to wait until the queue clears up (after removing ingest)?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [August 16, 2024, 4:38pm UTC](https://discuss.elastic.co/t/how-to-free-up-write-thread-queues/364981/4 "2024-08-16T16:38:21Z")

</div>

> [@erikg](#):
>
> wouldn't it be better to flush out the write queue instead of having to wait until the queue clears up (after removing ingest)?

Why? Would that not potentially increase the risk of data loss or partial writes?

---

<div class="post-metadata">

### Author: ![erikg](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@erikg](https://discuss.elastic.co/u/erikg)
#### Post date: [August 16, 2024, 4:56pm UTC](https://discuss.elastic.co/t/how-to-free-up-write-thread-queues/364981/5 "2024-08-16T16:56:36Z")

</div>

Because if the cluster is failing to balance because it has filled up queue, it will reject data via thread pool rejections anyways.

I think being able to clear up the queue instead of stopping majority of our data ingestion and also having to wait until the queue clears ups is not ideal.

Or idk, like mentioned this happened to us. It was a lot of effort to balance out the cluster and it was all due to queue being filled after we attempted to ingest new data.

So we stopped the ingest of the new data but that didn't help. In order to get the cluster back to normal, we had to peel majority of our normal data ingestion in order for the cluster to catch up.
