# How to increase the speed of response?

**URL:** https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190
**Category:** Elasticsearch
**Created:** [September 7, 2024, 2:13pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190 "2024-09-07T14:13:08Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)
#### Post date: [September 7, 2024, 2:13pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/1 "2024-09-07T14:13:08Z")

</div>

Hi  
I have a lot of data up to 10 billion and in order to be quick I made 7 contracts and it was still very slow  
What is the best practice in order to be a quick response?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [September 7, 2024, 3:00pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/2 "2024-09-07T15:00:06Z")

</div>

What do you mean?  
Any example of a request and a response?

---

<div class="post-metadata">

### Author: ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)
#### Post date: [September 8, 2024, 4:40pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/3 "2024-09-08T16:40:24Z")

</div>

I mean that I have a lot of data that can be increased very quickly so how can I make it very fast  
What do you advise me to be quick

For example  
Suppose I have data the size of Netflix data, what is the best practice to be fast?

---

<div class="post-metadata">

### Author: ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)
#### Post date: [September 8, 2024, 4:41pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/4 "2024-09-08T16:41:54Z")

</div>

I do not have a specific request, it is very slow in all requests

---

<div class="post-metadata">

### Author: ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)
#### Post date: [September 8, 2024, 4:49pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/5 "2024-09-08T16:49:11Z")

</div>

I use the following search:  
Query string  
Match  
Match all  
Term  
Wildcard

---

<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: [September 8, 2024, 4:53pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/6 "2024-09-08T16:53:04Z")

</div>

Wildcard queries are generally one of, if not the, slowest type of query in Elasticsearch (especially leading wildcard clauses) so based on the information you have provided I suspect that is at least part of your problem. Try removing any wildcard query clauses and see how this affects latency.

If you can get around the need for wildcard queries, index your data using the [wildcard field type](https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html#wildcard-field-type) and use this for wildcard queries.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [September 8, 2024, 4:59pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/7 "2024-09-08T16:59:39Z")

</div>

It would help to show examples of requests and responses.  
Also what is your version? What is the hardware used? How many nodes? How many shards????

---

<div class="post-metadata">

### Author: ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)
#### Post date: [September 8, 2024, 5:34pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/8 "2024-09-08T17:34:46Z")

</div>

I need it so much.I need it so much.

---

<div class="post-metadata">

### Author: ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)
#### Post date: [September 8, 2024, 5:42pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/9 "2024-09-08T17:42:25Z")

</div>

> [@dadoonet](#):
>
> It would help to show examples of requests and responses.  
> Also what is your version? What is the hardware used? How many nodes? How many shards????

In general, all requests are very slow, the response time is high.

For example I want to fetch data provided that there are 3 fields that have specific values

Version : 8.15.1  
Devices used : ZBOOK  
RAM:64  
Number of nodes : 7

---

<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: [September 8, 2024, 7:00pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/10 "2024-09-08T19:00:33Z")

</div>

Are you running 7 nodes on a single laptop? If so, why? Does it have an SSD?

How many shards are you querying? What is the total size of all shards? What is the average shard size?

---

<div class="post-metadata">

### Author: ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)
#### Post date: [September 8, 2024, 7:03pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/11 "2024-09-08T19:03:21Z")

</div>

No  
I am running 7 nodes on 7 different environments

---

<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: [September 8, 2024, 7:04pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/12 "2024-09-08T19:04:38Z")

</div>

Do the nodes have SSD?

How many shards are you querying? What is the total size of all shards? What is the average shard size?

---

<div class="post-metadata">

### Author: ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)
#### Post date: [September 8, 2024, 7:09pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/13 "2024-09-08T19:09:49Z")

</div>

Yes, it contains an SSD and at the same time HDD, I save the data on the HDD, but elastic is installed on the SSD disk, but I change the data.baht to the HDD disk

As for the size of the fragments, it is 1 per index, and the data is divided into 30 indexes for each index, one fragment

---

<div class="post-metadata">

### Author: ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)
#### Post date: [September 8, 2024, 7:11pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/14 "2024-09-08T19:11:11Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> size of all shards

size of all shards 5TB

---

<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: [September 8, 2024, 7:13pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/16 "2024-09-08T19:13:35Z")

</div>

> [@dsagent](#):
>
> Yes, it contains an SSD and at the same time HDD, I save the data on the HDD, but elastic is installed on the SSD disk, but I change the data.baht to the HDD disk

This means that the Elasticsearch data sits on the HDD which tend to have very limited I/O performance. As you can see from the [official guide on tuning for search speed](https://www.elastic.co/guide/en/elasticsearch/reference/current/tune-for-search-speed.html) it is recommended to use SSD for the Elasticsearch data directory.

> [@dsagent](#):
>
> size of all shards 5TB

Is that total size or size per shard?

---

<div class="post-metadata">

### Author: ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)
#### Post date: [September 8, 2024, 7:13pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/17 "2024-09-08T19:13:51Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> Do the nodes have SSD?

Yes, all nodes contain an SSD, but the place to save the data is on HDD

---

<div class="post-metadata">

### Author: ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)
#### Post date: [September 8, 2024, 7:17pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/18 "2024-09-08T19:17:23Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> Is that total size of size per shard?

No, this is the total size of all fragments, and it is not only increasing on a daily basis.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [September 8, 2024, 7:19pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/19 "2024-09-08T19:19:27Z")

</div>

> [@dsagent](#):
>
> In general, all requests are very slow, the response time is high.

It does not help.  
Unless you are saying that running the following request is super slow:

```
GET /index/_search

```

---

<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: [September 8, 2024, 7:23pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/20 "2024-09-08T19:23:12Z")

</div>

I would recommend the following:

- Move the Elasticsearch data directory to SSD on all nodes.
- Provide the full output of the [cat shards API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html).
- Show your mappings as well as a sample query that is slow.
- If you have only 5GB of data spread across 30 indices, reindex the data into a single index and see what impact on latency that has.
- Remove the wildcard clause/clauses and see if that impacts latency.

---

<div class="post-metadata">

### Author: ![dsagent](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dsagent](https://discuss.elastic.co/u/dsagent)
#### Post date: [September 8, 2024, 7:30pm UTC](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190/21 "2024-09-08T19:30:55Z")

</div>

Well, I'm going to try that out.

Thank you

[Next page](https://discuss.elastic.co/t/how-to-increase-the-speed-of-response/366190.md?page=2)
