# Elasticsearch index throughtput

**URL:** <https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160>\
**Category:** Elasticsearch\
**Created:** [March 13, 2019, 1:34pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160 "2019-03-13T13:34:19Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jayabal\_K](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jayabal_k/32/41905_2.png) [@Jayabal\_K](https://discuss.elastic.co/u/Jayabal_K)\
**Post date:** [March 13, 2019, 1:34pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/1 "2019-03-13T13:34:19Z")

</div>

We have ES-Cluster setup as following, but we cant index not more than 1000 documents per second. We are trying verifying performance and scalablity.

Client node (2 cpu,4GB memory) - 1  
Data node (2 cpu,4GB memory) - 10  
master (2 cpu,4GB memory) - 1

Expectation  
Trying to index 100k documents per second. Please let us know best practice

Thanks in advance

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 13, 2019, 1:47pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/2 "2019-03-13T13:47:08Z")

</div>

What are you using for your benchmarks? We recommend [Rally](https://github.com/elastic/rally). Benchmarking is a tricky thing to get right and it's very easy to introduce errors or to measure something different from what you think you're measuring.

Are you indexing via the single client node? If you add a second client node do you get higher throughput? If so, it looks like you're measuring the throughput of a single client node rather than the capacity of the whole cluster.

---

<div class="post-metadata">

**Author:** ![Jayabal\_K](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jayabal_k/32/41905_2.png) [@Jayabal\_K](https://discuss.elastic.co/u/Jayabal_K)\
**Post date:** [March 13, 2019, 2:00pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/3 "2019-03-13T14:00:06Z")

</div>

We are using our own simulator to simulate the documents.  
Yes, we are using single coordinator node(client). Also tried with 2 coordinator node, but no luck.

Is it possible to index 100k documents per second? Do we need to change any cluster configuration?

What are the best practices to setup ES-cluster?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 13, 2019, 3:42pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/4 "2019-03-13T15:42:43Z")

</div>

> [@Jayabal\_K](#):
>
> Is it possible to index 100k documents per second?

Yes. Our [Rally-based benchmarks](https://elasticsearch-benchmarks.elastic.co/#tracks/http-logs/nightly/30d) regularly exceed this indexing rate by some margin, on a 3-node cluster.

---

<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:** [March 13, 2019, 3:48pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/5 "2019-03-13T15:48:08Z")

</div>

What is the size and structure of your documents? Have you identified what is limiting throughput, e.g. CPU and/or disk I/O?

---

<div class="post-metadata">

**Author:** ![Jayabal\_K](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jayabal_k/32/41905_2.png) [@Jayabal\_K](https://discuss.elastic.co/u/Jayabal_K)\
**Post date:** [March 13, 2019, 5:06pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/6 "2019-03-13T17:06:48Z")

</div>

could you share your 3 node cluster details?. It will be useful to analyse whats is blocking in my setup.

---

<div class="post-metadata">

**Author:** ![Jayabal\_K](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jayabal_k/32/41905_2.png) [@Jayabal\_K](https://discuss.elastic.co/u/Jayabal_K)\
**Post date:** [March 13, 2019, 5:10pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/7 "2019-03-13T17:10:07Z")

</div>

My documents size is around 1kb which contains 20 attributes(key-value pair) in it.  
I gone though the kibana monitoring it shows low CPU and disk utilization.  
I don't know what was blocking.Please guide me how to analyse it.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 13, 2019, 5:38pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/8 "2019-03-13T17:38:27Z")

</div>

Sure, the [benchmark website](https://elasticsearch-benchmarks.elastic.co/#) has an overview:

#### Current environment

All benchmarks are run on bare-metal machines with the following specifications:

- CPU: [Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz](https://ark.intel.com/de/products/97128/Intel-Core-i7-7700-Processor-8M-Cache-up-to-4_20-GHz)
- RAM: 32 GB
- SSD:
  - Data disk of first target machine: [Micron\_M600\_MTFDDAK512MBF](https://www.micron.com/~/media/documents/products/data-sheet/ssd/m600_2_5_ssd.pdf)
  - Every other disk: SAMSUNG MZ7LN512HMJP-00000

- OS: Linux kernel version 4.13.0-38
- OS TUNING:
  - /sys/kernel/mm/transparent\_hugepage/enabled = always
  - /sys/kernel/mm/transparent\_hugepage/defrag = always

- JVM: Oracle JDK 1.8.0\_131-b11

> [@Jayabal\_K](#):
>
> My documents size is around 1kb which contains 20 attributes(key-value pair) in it.  
> I gone though the kibana monitoring it shows low CPU and disk utilization.  
> I don't know what was blocking.Please guide me how to analyse it.

If it's not the client node, the next thing I'd suspect is the test harness itself. You're trying to push about 100MB/s of data at the cluster, and it's possible that the test harness you've written just isn't fast enough to do this.

If the bottleneck is Elasticsearch then I'd expect to see tasks building up on the client node. You can see how busy the client node is by looking at things like `GET /_nodes/CLIENT-NODE-NAME/stats/thread_pool` and `GET /_tasks?nodes=CLIENT-NODE-NAME`. If the client node looks quiet then the bottleneck is outside the system.

---

<div class="post-metadata">

**Author:** ![Jayabal\_K](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jayabal_k/32/41905_2.png) [@Jayabal\_K](https://discuss.elastic.co/u/Jayabal_K)\
**Post date:** [March 14, 2019, 4:47pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/9 "2019-03-14T16:47:12Z")

</div>

I able to achieve 100K rps using rally (benchmark tool) via bulk API. But using more numbers of single document index request (in parallel) index throughput could not go beyond 1000 rps.

Is bullk API is the only way to achieve 100K rps ? Or something else need to be focused for single document API?

Please advice.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 14, 2019, 4:48pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/10 "2019-03-14T16:48:49Z")

</div>

Yes, the bulk API is the correct way to achieve high indexing throughput.

---

<div class="post-metadata">

**Author:** ![Jayabal\_K](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jayabal_k/32/41905_2.png) [@Jayabal\_K](https://discuss.elastic.co/u/Jayabal_K)\
**Post date:** [March 14, 2019, 4:51pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/11 "2019-03-14T16:51:27Z")

</div>

For our real time scenario, there could more possible to get more number single doc index request.

Is there any way to get good rps using single indexing API?

---

<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:** [March 14, 2019, 5:37pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/12 "2019-03-14T17:37:01Z")

</div>

Indexing a single document at a time results in a lot more overhead per document in terms of request processing and syncing to disk and is therefore always going to be considerably slower than using bulk requests.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 14, 2019, 6:25pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/13 "2019-03-14T18:25:07Z")

</div>

> [@Jayabal\_K](#):
>
> Is there any way to get good rps using single indexing API?

To get the best throughput (and lower latency too) it's normally best to collect your requests into reasonable-sized batches before indexing them. You say you have a realtime scenario: what exactly are your latency targets?

---

<div class="post-metadata">

**Author:** ![Jayabal\_K](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jayabal_k/32/41905_2.png) [@Jayabal\_K](https://discuss.elastic.co/u/Jayabal_K)\
**Post date:** [March 20, 2019, 1:42pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/14 "2019-03-20T13:42:09Z")

</div>

I able to get 50K rps using bulk api(size : 5000) and index mapping(not using dynamic mapping).

I have one question regarding the mapping.

Could you please explain what is field mapping and difference between (type : text and filed : { type : keyword})?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 20, 2019, 3:17pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/15 "2019-03-20T15:17:03Z")

</div>

Perhaps this helps: [https://www.elastic.co/blog/strings-are-dead-long-live-strings](https://www.elastic.co/blog/strings-are-dead-long-live-strings)

If you have more questions about mapping then I suggest you open a new thread rather than continuing here.

---

<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:** [April 17, 2019, 3:17pm UTC](https://discuss.elastic.co/t/elasticsearch-index-throughtput/172160/16 "2019-04-17T15:17:14Z")

</div>

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