Script Compilation Cache Pressure
warningExcessive script compilation from unique painless scripts can exhaust the compilation cache, trigger rate limiting, and impact query performance.
elasticsearch.node.script.compilations increasing significantly with growing elasticsearch.node.script.cache_evictions, or elasticsearch.node.script.compilation_limit_triggered showing rate limit hits
Review script usage patterns: (1) Parameterize scripts instead of embedding values directly - use script.painless.regex.enabled:false to force parameterization, (2) Increase script.context.*.cache_max_size from default 100, (3) Reduce unique script variations - consolidate similar scripts. Monitor script.painless.compile setting (default 150/5m rate limit). For high compilation rates, consider: pre-compiling frequently used scripts, using stored scripts instead of inline, or moving complex logic to application layer. Check if ML inference or other features use scripts internally. Excessive compilations indicate inefficient query patterns that should be refactored.