elasticsearch understand thread pool


Kaushik

Thread Pool Reference (Official)

I have a few questions about the above references

  1. For search requests: how many threads are needed if my index has 2 shards
  2. For batch/write requests: how many threads are needed if my index has 2 shards
  3. Do write and search requests have dedicated threads? That is, the number of search requests does not affect the write thread/thread queue
  4. If a thread is writing to 'Index_1', will a lock be created on the index? If I have parallel search requests to the same index, does it have to wait until the write is done?
Elasticsearch Ninja

inline answer

1. For search requests: If my index has 2 shards, how many threads will it require ?

ES creates a separate thread for each primary shard.

2. Batch/Write Requests: How many threads will be needed if my index has 2 shards

same as the first answer

3. Are there dedicated threads for write and search requests? That is, the number of search requests does not affect the write thread/thread queue

Yes, they have their own thread pool. The search pool is used for counting/searching/suggesting operations. Write a thread pool for single-document index/delete/update and batch requests. More info on the same official link in the question.

Helpful opster blog at https://opster.com/elasticsearch-glossary/elasticsearch-search-latency-burst-of-search-traffic-guide/

From the above blog, it answers your first and second questions.

ES creates a separate thread to query each shard, and a separate fixed-size thread pool for search queries

Related


Name the thread and thread pool of ExecutorService

gentlemen: Suppose I have an application that utilizes Executorframeworks like this Executors.newSingleThreadExecutor().submit(new Runnable(){ @Override public void run(){ // do stuff } } When I run this application in the debugger, a thre

Thread pool is similar to multiprocessing pool?

Martin: Is there a Pool class for worker threads , similar to the Multiprocessing module's Pool class ? For example, I like the easy way to parallelize the map function def long_running_func(p): c_func_no_gil(p) p = multiprocessing.Pool(4) xs = p.map(long

Difference Between Thread and Thread Pool

Syed Abdul Kather Can someone guide me with an example of Thread and ThreadPool? What is the difference between them? Best to use...? what is its downside Thomas: Since a thread can only run once, each task must use one thread. However, creating and starting t

Change the latency of a thread in a thread pool

ml I added three threads with different tasks and different delays to the thread pool and everything works fine. static ScheduledExecutorService scheduleTaskExecutor; static ScheduledFuture<?> future1; static ScheduledFuture<?> future2; static ScheduledFuture<

Name the thread and thread pool of ExecutorService

gentlemen: Suppose I have an application that utilizes Executorframeworks like this Executors.newSingleThreadExecutor().submit(new Runnable(){ @Override public void run(){ // do stuff } } When I run this application in the debugger, a thre

Rejection from search thread_pool Elasticsearch

Amar C I have an Elasticsearch cluster of 6 nodes. The heap size is set to 50GB. (I know a size smaller than 32 is recommended, but I've set it to 50Gb for some reason, I don't know). Now, I see a lot of rejections from searching for thread_pool. [2020-10-26T1

Change the latency of a thread in a thread pool

ml I added three threads with different tasks and different delays to the thread pool and everything works fine. static ScheduledExecutorService scheduleTaskExecutor; static ScheduledFuture<?> future1; static ScheduledFuture<?> future2; static ScheduledFuture<

Thread pool is similar to multiprocessing pool?

Martin: Is there a Pool class for worker threads , similar to the Multiprocessing module's Pool class ? For example, I like the easy way to parallelize the map function def long_running_func(p): c_func_no_gil(p) p = multiprocessing.Pool(4) xs = p.map(long

Difference Between Thread and Thread Pool

Syed Abdul Kather Can someone guide me with an example of Thread and ThreadPool? What is the difference between them? Best to use...? what is its downside Thomas: Since a thread can only run once, each task must use one thread. However, creating and starting t

Check if thread returns to thread pool

username How to check if a thread returns to thread pool using VS C# 2015 debugger? The problem in my case was that it couldn't be detected by debugging line by line. async Task foo() { int y = 0; await Task.Delay(5); // (1) thread 2000 returns to

elasticsearch understand thread pool

Kaushik Thread Pool Reference (Official) I have a few questions about the above references For search requests: how many threads are needed if my index has 2 shards For batch/write requests: how many threads are needed if my index has 2 shards Do write and sea

elasticsearch understand thread pool

Kaushik Thread Pool Reference (Official) I have a few questions about the above references For search requests: how many threads are needed if my index has 2 shards For batch/write requests: how many threads are needed if my index has 2 shards Do write and sea

JAVA thread pool reuse thread

malt Everyone. I have a misunderstanding about using thread pools. Actual results differ from the API description of this class. When I LinkedBlockedQueueuse it in the thread pool without reusing the thread, the thread pool will wait for the KeepAliveTime set

Change the latency of a thread in a thread pool

ml I added three threads with different tasks and different delays to the thread pool and everything works fine. static ScheduledExecutorService scheduleTaskExecutor; static ScheduledFuture<?> future1; static ScheduledFuture<?> future2; static ScheduledFuture<

Rejection from search thread_pool Elasticsearch

Amar C I have an Elasticsearch cluster of 6 nodes. The heap size is set to 50GB. (I know a size smaller than 32 is recommended, but I've set it to 50Gb for some reason, I don't know). Now, I see a lot of rejections from searching for thread_pool. [2020-10-26T1

JAVA thread pool reuse thread

malt Everyone. I have a misunderstanding about using thread pools. Actual results differ from the API description of this class. When I LinkedBlockedQueueuse it in the thread pool without reusing the thread, the thread pool will wait for the KeepAliveTime set

Suspend thread of thread pool in C

Sameksha Gupta I'm working on a parallel programming based project and I need to execute a given task as efficiently as possible (in terms of time and energy consumption). For this, I need to suspend some threads from the worker pool based on some conditions.

Change the latency of a thread in a thread pool

ml I added three threads with different tasks and different delays to the thread pool and everything works fine. static ScheduledExecutorService scheduleTaskExecutor; static ScheduledFuture<?> future1; static ScheduledFuture<?> future2; static ScheduledFuture<

Name the thread and thread pool of ExecutorService

gentlemen: Suppose I have an application that utilizes Executorframeworks like this Executors.newSingleThreadExecutor().submit(new Runnable(){ @Override public void run(){ // do stuff } } When I run this application in the debugger, a thre

Thread pool is similar to multiprocessing pool?

Martin: Is there a Pool class for worker threads , similar to the Multiprocessing module's Pool class ? For example, I like the easy way to parallelize the map function def long_running_func(p): c_func_no_gil(p) p = multiprocessing.Pool(4) xs = p.map(long

Difference Between Thread and Thread Pool

Syed Abdul Kather Can someone guide me with an example of Thread and ThreadPool? What is the difference between them? Best to use...? what is its downside Thomas: Since a thread can only run once, each task must use one thread. However, creating and starting t

elasticsearch understand thread pool

Kaushik Thread Pool Reference (Official) I have a few questions about the above references For search requests: how many threads are needed if my index has 2 shards For batch/write requests: how many threads are needed if my index has 2 shards Do write and sea

elasticsearch understand thread pool

Kaushik Thread Pool Reference (Official) I have a few questions about the above references For search requests: how many threads are needed if my index has 2 shards For batch/write requests: how many threads are needed if my index has 2 shards Do write and sea

Change the latency of a thread in a thread pool

ml I added three threads with different tasks and different delays to the thread pool and everything works fine. static ScheduledExecutorService scheduleTaskExecutor; static ScheduledFuture<?> future1; static ScheduledFuture<?> future2; static ScheduledFuture<

Rejection from search thread_pool Elasticsearch

Amar C I have an Elasticsearch cluster of 6 nodes. The heap size is set to 50GB. (I know a size smaller than 32 is recommended, but I've set it to 50Gb for some reason, I don't know). Now, I see a lot of rejections from searching for thread_pool. [2020-10-26T1

elasticsearch understand thread pool

Kaushik Thread Pool Reference (Official) I have a few questions about the above references For search requests: how many threads are needed if my index has 2 shards For batch/write requests: how many threads are needed if my index has 2 shards Do write and sea

elasticsearch understand thread pool

Kaushik Thread Pool Reference (Official) I have a few questions about the above references For search requests: how many threads are needed if my index has 2 shards For batch/write requests: how many threads are needed if my index has 2 shards Do write and sea