Unkown script compilations for template-context in script-cache

Hi,

from time to time we are facing a 'circuit_breaking_exception' caused by 'Too many dynamic script compilations within, max: [75/5m]'

We only use 2 score_scripts to re-rank the score of documents. These 2 scripts using parameters and ist seems they are not causing the above problem.

When we look into the script-cache:

GET /_nodes/stats?metric=script&filter_path=nodes.*.script.*
{
  "nodes" : {
    "_4Z2Cur6Qem_yiz11wzN3Q" : {
      "script" : {
        "compilations" : 985845,
        "cache_evictions" : 985699,
        "compilation_limit_triggered" : 1778
      }
    },
    "pt9TnJkLQEexDLlKkx_vpQ" : {
      "script" : {
        "compilations" : 1029367,
        "cache_evictions" : 1029250,
        "compilation_limit_triggered" : 2239
      }
    },
    "MsGjak10Q3i3AVKWv8QzHA" : {
      "script" : {
        "compilations" : 818710,
        "cache_evictions" : 818594,
        "compilation_limit_triggered" : 2009
      }
    }
  }
}

There are a lot of compilations happening and the compilation limit is reached quite often...
The compilations are increasing constantly little by little, but sometimes quite fast.

When we look into the cache a little bit deeper:

GET /_nodes/stats?metric=script_cache
"script_cache" : {
        "sum" : {
          "compilations" : 985845,
          "cache_evictions" : 985699,
          "compilation_limit_triggered" : 1778
        },
        "contexts" : [
          ...
          {
            "context" : "score",
            "compilations" : 2,
            "cache_evictions" : 0,
            "compilation_limit_triggered" : 0
          },
          ...
          {
            "context" : "template",
            "compilations" : 985822,
            "cache_evictions" : 985722,
            "compilation_limit_triggered" : 1778
          },
          ...

You can see, the 2 score_scripts are only compiled twice. The problem part seems to be the template-context.

Our question would be:
What is the template-context in the script_cache and what features, technologies, plugins etc.. is contributing to the template-context. We want to get a better understand what is going on behind the scenes, maybe we are using some feature that we are not aware off and we could fix the problem be deactivating it...

Many thanks,

Hans

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