# Kibana query performance

**URL:** <https://discuss.elastic.co/t/kibana-query-performance/279363>\
**Category:** Kibana\
**Created:** [July 22, 2021, 9:45am UTC](https://discuss.elastic.co/t/kibana-query-performance/279363 "2021-07-22T09:45:36Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![paigekim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paigekim/32/91494_2.png) [@paigekim](https://discuss.elastic.co/u/paigekim)\
**Post date:** [July 22, 2021, 9:45am UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/1 "2021-07-22T09:45:36Z")

</div>

Hello,

I am currently drawing graphs and charts from Kibana, but it takes longer than the time that I started to draw. Compared to the beginning, there are obviously more data, but I am not sure it is still count as slow, and I need to find a way to make the performance better or not.

For example, I have 'test' index pattern and it has 28 fields and 1 scripted field. From that index pattern, I have total of 17 charts, pies, and map. Among those, one of pie charts hits of 12,374,715 hits and takes qurey time as 11835ms.

Is there any other information I should provide for you to determine whether the performance of my kibana is slow or not? Please let me know.

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [July 22, 2021, 10:32am UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/2 "2021-07-22T10:32:11Z")

</div>

Hi, what kibana/es version are you using?  
Are you building the pie visualization through Lens or the Visualize (aggregated) pie chart?  
Can you share the configuration of the pie (a screenshot or a set of them is also fine)?

---

<div class="post-metadata">

**Author:** ![paigekim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paigekim/32/91494_2.png) [@paigekim](https://discuss.elastic.co/u/paigekim)\
**Post date:** [July 22, 2021, 11:09am UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/3 "2021-07-22T11:09:22Z")

</div>

Thank you for your prompt reply!

Current Kibana version is v7.12.1.

I am using both lens and Visualize pie chart, but the example I mentioned on the question was Visualize pie chart. Please see the attached for your reference.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/d/fdd81e19a498dfad1ea32f49304607d5c7f29dc9.png)

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [July 22, 2021, 11:25am UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/4 "2021-07-22T11:25:28Z")

</div>

The pie chart configuration looks simple enough and doesn't looks like too heavy.  
17 visualization on a dashboard looks a bit too much for a dashboard, do you see a slow performance also with a dashboard with less visualizations (4/8 max) ? Does the pie chart decrease the speed or is a general poor performance?

---

<div class="post-metadata">

**Author:** ![paigekim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paigekim/32/91494_2.png) [@paigekim](https://discuss.elastic.co/u/paigekim)\
**Post date:** [July 22, 2021, 11:50am UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/5 "2021-07-22T11:50:59Z")

</div>

If it is less visualization, it speeds up and also if there is less data to draw, it shortens time as well.

I made an example of pie chart because i can track the query time through options easily. On the network tab, I do see lots of bssearch api request but I cannot really tell which one slows down.

If the problem is the amount of data, is there any way I can improve the performance by not decreasing numbers of visualizations? All of those are needed to be shown in one dashboard if possible.

Lastly, I see 12,374,715 total hits from the discover tab for the past 10 years range. If Kibana draws Visualize with this, and there are 17 visualizations, do you think approximate 12 seconds to render is proper time I should wait for? Or should I look for a way to improve the time? If I do, would you give me some suggestions? And the data is currently added more every day and I am worried if it will slow more..

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [July 22, 2021, 1:20pm UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/6 "2021-07-22T13:20:57Z")

</div>

Does the problem persist when you are in the visualize editor? does the visualization takes a lot to render?

---

<div class="post-metadata">

**Author:** ![paigekim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paigekim/32/91494_2.png) [@paigekim](https://discuss.elastic.co/u/paigekim)\
**Post date:** [July 23, 2021, 12:10am UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/7 "2021-07-23T00:10:26Z")

</div>

It happens both.

I do have 6 other dashboards and only experience on several dashboards that have lots of data in total on certain index patterns. So I was thinking about the problem can be the amounts of data.

---

<div class="post-metadata">

**Author:** ![paigekim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paigekim/32/91494_2.png) [@paigekim](https://discuss.elastic.co/u/paigekim)\
**Post date:** [July 23, 2021, 6:02am UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/8 "2021-07-23T06:02:34Z")

</div>

I actually found out that one of pie charts that I drew by Lens has a loading sign and render at the end even though other charts are already drawn. I attached the screenshot of loading(just hide the title of the chart) and its configuration.

I know you asked me earlier whether I drew by Lens or Visualize pie chart. Does Visualize pie chart has better performance than Lens?

 ![스크린샷 2021-07-23 오후 2.54.28](https://us1.discourse-cdn.com/elastic/original/3X/a/d/addda3981257ee3547dd49a2b5ee17a77c2c924a.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/e/2e24a74ea70a84aa14002f68081064bb9d241a96.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/e/2e3ed5e08d63387f0a535be68c2ce28fbe2de439.png)

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [July 26, 2021, 12:31pm UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/9 "2021-07-26T12:31:05Z")

</div>

The pie chart configuration looks actually simple enough to be computed without any specific performance impact.  
Can you please share the content of `GET _cluster/health` to understand how your cluster is configured? Can you also give me some details on the current cluster hardware specification?

---

<div class="post-metadata">

**Author:** ![paigekim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paigekim/32/91494_2.png) [@paigekim](https://discuss.elastic.co/u/paigekim)\
**Post date:** [July 27, 2021, 3:39am UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/10 "2021-07-27T03:39:34Z")

</div>

The following is the content of GET \_cluster/health

```auto
{
  "status": "green",
  "number_of_nodes": 3,
  "unassigned_shards": 0,
  "number_of_pending_tasks": 0,
  "number_of_in_flight_fetch": 0,
  "timed_out": false,
  "active_primary_shards": 201,
  "task_max_waiting_in_queue_millis": 0,
  "cluster_name": "...",
  "relocating_shards": 0,
  "active_shards_percent_as_number": 100,
  "active_shards": 402,
  "initializing_shards": 0,
  "number_of_data_nodes": 2,
  "delayed_unassigned_shards": 0
}

```

 ![스크린샷 2021-07-27 오후 12.38.20](https://us1.discourse-cdn.com/elastic/original/3X/3/4/34a505f360c84a3971bfcb25e5dfb82cf448a082.png)  
And the total number of shards is 402.

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [July 27, 2021, 8:20am UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/11 "2021-07-27T08:20:48Z")

</div>

On the piechart configuration, you are using a `timestamp_year` field to split the chart into small multiples. Is that the scripted field? if so this could be the bottleneck, as the scripted field needs to be executed on every document and the result is not indexed.  
You can gain more speed if that field is indexed as a numeric field instead of a scripted one. Before reindexing your data, you can try if this speeds up the chart using a different indexed field instead of the scripted one.

---

<div class="post-metadata">

**Author:** ![paigekim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paigekim/32/91494_2.png) [@paigekim](https://discuss.elastic.co/u/paigekim)\
**Post date:** [July 28, 2021, 10:57am UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/12 "2021-07-28T10:57:35Z")

</div>

Actually timestamp\_year is not the scripted field. It is a keyword that I created manually.

Do you think is there any issue on the cluster health or cluster hardware specification?

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [July 28, 2021, 12:32pm UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/13 "2021-07-28T12:32:03Z")

</div>

The number of shards looks a bit high for 3 nodes, how many indices do you have?  
We usually link to those resources to understand exactly how many shards are needed

> **[Size your shards | Elasticsearch Guide \[7.13\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/size-your-shards.html)**

> **[How many shards should I have in my Elasticsearch cluster?](https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster)**

btw, you are not the first user that describes such kind of bad performance in the dashboard environment and the Kibana team is currently triaging another issue, similar to yours  
I will keep you posted

---

<div class="post-metadata">

**Author:** ![paigekim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paigekim/32/91494_2.png) [@paigekim](https://discuss.elastic.co/u/paigekim)\
**Post date:** [July 28, 2021, 11:46pm UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/14 "2021-07-28T23:46:53Z")

</div>

Current indices are 200, but it is adding up daily.

I will wait for the update!

---

<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:** [August 25, 2021, 11:47pm UTC](https://discuss.elastic.co/t/kibana-query-performance/279363/15 "2021-08-25T23:47:36Z")

</div>

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