# Kibana Slow Perfomance Script Fields and many fields

**URL:** <https://discuss.elastic.co/t/kibana-slow-perfomance-script-fields-and-many-fields/86541>\
**Category:** Kibana\
**Created:** [May 20, 2017, 10:14pm UTC](https://discuss.elastic.co/t/kibana-slow-perfomance-script-fields-and-many-fields/86541 "2017-05-20T22:14:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rodrigo\_Tornis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rodrigo_tornis/32/18015_2.png) [@Rodrigo\_Tornis](https://discuss.elastic.co/u/Rodrigo_Tornis)\
**Post date:** [May 20, 2017, 10:14pm UTC](https://discuss.elastic.co/t/kibana-slow-perfomance-script-fields-and-many-fields/86541/1 "2017-05-20T22:14:13Z")

</div>

Hello Everyone!

I am doing a proof of concept with ELK and I have the following doubts regarding specifically Kibana.

My hardware

Core I5 ​​quad core  
16GB RAM  
Linux OS Ubuntu Server  
JVM for Elasticsearch 5.4 8GB Heap  
Kibana 5.4

1 - In my tests, I see that Kibana takes a lot of time to load indexes above 1000 fields. It takes time to set the indices on Kibana and the discovery process. One tactic I used was to load a document into the index to speed up loading in kibana to set the timestamp field. Is there a way to improve this load in the first configuration of the index and in the discovery process?

2- On scripts fields, I saw that the community recommendation is to use scripts moderately because it can impact performance depending on the complexity of the script. In my case I am doing a test using 7 fields scripts with the following code:

Painless

`If (doc ['FIELD1.keyword']. Value == "Y") {return "OUTPUT"} else If (doc ['FIELD1.keyword']. Value == "Z") {return "OTHER"}`

I was surprised by the delay in the loading time of only 2,000 documents (5 minutes approx). Is this behavior normal or is there really a performance problem when I use relatively simple  
scripts? How can I improve this?

3 - On Painless for parameters, can you set the parameter value to a value of a field?

4 - Another doubt and about functions in Painless. How can I create a function and within that function read fields. My example below the error because the function does not know the field I'm trying to read:

Painless

```
String my_test (x) {
If (doc ['field1']. Value == X) {
Return 0
} Else {
Return 1
}

```

In this example error returns because the function does not recognize the doc ['field1']. Value. How can I resolve this?

Thanks in advance to everyone.

Best regards

Rodrigo Tornis

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 20, 2017, 10:44pm UTC](https://discuss.elastic.co/t/kibana-slow-perfomance-script-fields-and-many-fields/86541/2 "2017-05-20T22:44:02Z")

</div>

Is everything running on the single host?

For the second one, you should definitely do this before ingestion.

---

<div class="post-metadata">

**Author:** ![Rodrigo\_Tornis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rodrigo_tornis/32/18015_2.png) [@Rodrigo\_Tornis](https://discuss.elastic.co/u/Rodrigo_Tornis)\
**Post date:** [May 26, 2017, 11:28am UTC](https://discuss.elastic.co/t/kibana-slow-perfomance-script-fields-and-many-fields/86541/3 "2017-05-26T11:28:58Z")

</div>

Hello @warkolm,

Thanks for response 🙂

Yes I,m running single host!

One way to solve slowness during discover was to disable the "doc\_table: highlight" and "doc\_table: highlight: all\_fields" option. This greatly improved the response time.

One way to resolve slowness during discover was to disable the "doc\_table: highlight" and "doc\_table: highlight: all\_fields" option in Kibana. This greatly improved the response time.

Now I have another problem!

I have an ALIASASE of name CRITICALDATASET linked with 4 index (index: SMF014, SMF015, SMF017, SMF030). I inserted 1000 docs in each index. In Kibana, I configured the index for the CRITICALDATASET Alias and all the fields appear in the Kibana mapping (figure 1).

 ![](https://us1.discourse-cdn.com/elastic/original/3X/5/5/550d60fcb1b4df3075a97032287b54c64f362fb7.png)

When you query the Alias in Discover, the SMF030 index is not found (Figure 2).

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

However, when I query the SMF030 index separately, the data is presented (Figure 3)

 ![](https://us1.discourse-cdn.com/elastic/original/3X/8/5/85dd8e7ab9a89a01c854dc1cba5960f781445b6e.png)

Even if a query is performed by the "type" field smf030 in the Alias CRITICALDATASET no result is displayed.

Can you help me?

---

<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:** [June 23, 2017, 11:29am UTC](https://discuss.elastic.co/t/kibana-slow-perfomance-script-fields-and-many-fields/86541/4 "2017-06-23T11:29:03Z")

</div>

Closed on June 23, 2017, 11:29am UTC

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