Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase max compilation rate for Filebeat modules tests #9777

Merged
merged 3 commits into from
Dec 27, 2018

Conversation

ruflin
Copy link
Member

@ruflin ruflin commented Dec 24, 2018

Module tests started to fail with the following message:

Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting

The reason for this is (I think) that we started to use scripts more heavily in our pipelines so we hit this limit. For the tests we can easily increase the limit to solve this. In production this could still be an issue when all pipelines are loaded at the same time and we need to find a solution here.

In parallel we should also investigate if there are some non parameterised scripts which get recompiled every time.

  • This also updates a generated Postgres file which was not updated properly.

@ruflin ruflin added module review Filebeat Filebeat :Testing Team:Integrations Label for the Integrations team labels Dec 24, 2018
@ruflin ruflin requested a review from a team as a code owner December 24, 2018 07:58
@ruflin
Copy link
Member Author

ruflin commented Dec 24, 2018

@jakelandis A few questions about the above:

  • When are scripts compile? When the pipeline is loaded or when the first event comes in?
  • Do grok patterns somehow also account as scripts? Asking because of the error I got below when trying to reproduce this locally:
2018-12-24T08:54:51.139+0100	DEBUG	[elasticsearch]	elasticsearch/client.go:537	Bulk item insert failed (i=0, status=500): {"type":"exception","reason":"java.lang.IllegalArgumentException: java.lang.IllegalStateException: pipeline with id [filebeat-7.0.0-logstash-slowlog-pipeline-plain] could not be loaded, caused by [ElasticsearchParseException[Error updating pipeline with id [filebeat-7.0.0-logstash-slowlog-pipeline-plain]]; nested: GeneralScriptException[Failed to compile inline script [logstash.slowlog.timestamp] using lang [mustache]]; nested: CircuitBreakingException[[script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting];; GeneralScriptException[Failed to compile inline script [logstash.slowlog.timestamp] using lang [mustache]]; nested: CircuitBreakingException[[script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting];; org.elasticsearch.common.breaker.CircuitBreakingException: [script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting]","caused_by":{"type":"illegal_argument_exception","reason":"java.lang.IllegalStateException: pipeline with id [filebeat-7.0.0-logstash-slowlog-pipeline-plain] could not be loaded, caused by [ElasticsearchParseException[Error updating pipeline with id [filebeat-7.0.0-logstash-slowlog-pipeline-plain]]; nested: GeneralScriptException[Failed to compile inline script [logstash.slowlog.timestamp] using lang [mustache]]; nested: CircuitBreakingException[[script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting];; GeneralScriptException[Failed to compile inline script [logstash.slowlog.timestamp] using lang [mustache]]; nested: CircuitBreakingException[[script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting];; org.elasticsearch.common.breaker.CircuitBreakingException: [script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting]","caused_by":{"type":"illegal_state_exception","reason":"pipeline with id [filebeat-7.0.0-logstash-slowlog-pipeline-plain] could not be loaded, caused by [ElasticsearchParseException[Error updating pipeline with id [filebeat-7.0.0-logstash-slowlog-pipeline-plain]]; nested: GeneralScriptException[Failed to compile inline script [logstash.slowlog.timestamp] using lang [mustache]]; nested: CircuitBreakingException[[script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting];; GeneralScriptException[Failed to compile inline script [logstash.slowlog.timestamp] using lang [mustache]]; nested: CircuitBreakingException[[script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting];; org.elasticsearch.common.breaker.CircuitBreakingException: [script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting]"}},"header":{"processor_type":"unknown"}}

The pipeline for the above can be found here: https://github.com/elastic/beats/blob/master/filebeat/module/logstash/slowlog/ingest/pipeline-plain.json It does not contain an scripts but quite a few grok patterns.

@ruflin
Copy link
Member Author

ruflin commented Dec 24, 2018

@jakelandis An interesting addition here. The docs state the limit is 15/min, but the error above says 75/5min which is similar but no the same ...

@@ -67,6 +67,14 @@ def init(self):

self.index_name = "test-filebeat-modules"

body = {
"transient": {
"script.max_compilations_rate": "100/1m"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is failing with:

Too many dynamic script compilations within, max: [100/1m]

So looks like even 100/1m is not enough 😬😬😬

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set it now to 1000/1m and at least locally it works. This is mainly to get test back to green. We should figure out about the why afterwards.

Module tests started to fail with the following message:

```
Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting
```

The reason for this is (I think) that we started to use scripts more heavily in our pipelines so we hit this limit. For the tests we can easily increase the limit to solve this. In production this could still be an issue when all pipelines are loaded at the same time and we need to find a solution here.

In parallel we should also investigate if there are some non parameterised scripts which get recompiled every time.
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating postgresql-9.6-new-timestamp.log-expected.json!

@ruflin ruflin merged commit aa4292a into elastic:master Dec 27, 2018
@ruflin ruflin mentioned this pull request Dec 28, 2018
1 task
ycombinator added a commit that referenced this pull request Jan 29, 2019
Partial backport of ##9777.

This PR ncreases the dynamic script compilations for Filebeat system tests to `1000/1m`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Filebeat Filebeat module review Team:Integrations Label for the Integrations team :Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants