How to dynamically set script.max_compilations_per_minute?

I know that we can add this config in elasticsearch.yml but i would like to do it dynamically.

documentation says we can change the setting dynamically.
https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting-using.html#prefer-params

please help me with the curl for updating this setting.

PS : I can't update this in elasticcloud too cause this setting is not supported in there configuration.

Hi @patlola,

just as a hint: you can reduce script compilations by using parameters. Then Elasticsearch needs to compile the script just once and call it many times with different parameters and this is much better for performance.

Having that said, here's what you need to do to change the setting:

PUT /_cluster/settings
{
    "transient" : {
        "script.max_compilations_per_minute" : 20
    }
}

Daniel

1 Like

Thanks @danielmitterdorfer , i will try this :smiley:

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