-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Use a cache instead of sync.Pool in script processor #19562
Conversation
Pinging @elastic/siem (Team:SIEM) |
💔 Tests FailedExpand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures
Steps errorsExpand to view the steps failures
Log outputExpand to view the last 100 lines of log output
|
@andrewkroh I was tempted to add another flag to control if it should be blocking if there are no instances available, or just the current approach of allocating a spare one. I'm not sure what the implications will be in the Winlogbeat use case. |
Jenkins, run tests please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. It needs a changelog entry.
This updates the script processor to keep a simple cache of Javascript VM sessions instead of relying on sync.Pool for this task. The size of this cache can be controlled by the new `max_cached_sessions` option. The reasoning behind this change is to avoid sync.Pool discarding and re-allocating new sessions every garbage collection cycle. For large Javascript pipelines, allocating a new session is a very expensive operation that can take hundreds of milliseconds or even seconds to complete. This has a severe impact in ingestion rates.
26c6a7b
to
6cb9c09
Compare
CI errors unrelated |
This updates the script processor to keep a simple cache of Javascript VM sessions instead of relying on sync.Pool for this task. The size of this cache can be controlled by the new `max_cached_sessions` option. The reasoning behind this change is to avoid sync.Pool discarding and re-allocating new sessions every garbage collection cycle. For large Javascript pipelines, allocating a new session is a very expensive operation that can take hundreds of milliseconds or even seconds to complete. This has a severe impact in ingestion rates. (cherry picked from commit 7930f9e)
This updates the script processor to keep a simple cache of Javascript VM sessions instead of relying on sync.Pool for this task. The size of this cache can be controlled by the new `max_cached_sessions` option. The reasoning behind this change is to avoid sync.Pool discarding and re-allocating new sessions every garbage collection cycle. For large Javascript pipelines, allocating a new session is a very expensive operation that can take hundreds of milliseconds or even seconds to complete. This has a severe impact in ingestion rates. (cherry picked from commit 7930f9e)
This updates the script processor to keep a simple cache of Javascript VM sessions instead of relying on sync.Pool for this task. The size of this cache can be controlled by the new `max_cached_sessions` option. The reasoning behind this change is to avoid sync.Pool discarding and re-allocating new sessions every garbage collection cycle. For large Javascript pipelines, allocating a new session is a very expensive operation that can take hundreds of milliseconds or even seconds to complete. This has a severe impact in ingestion rates.
What does this PR do?
Updates the script processor to keep a simple cache of Javascript VM sessions instead of relying on sync.Pool for this task.
Why is it important?
The reasoning behind this change is to avoid sync.Pool discarding and re-allocating new sessions every garbage collection cycle. For large Javascript pipelines, allocating a new session is a very expensive operation that can take hundreds of milliseconds, even seconds to complete. This has a severe impact in ingestion rates.
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesI have added tests that prove my fix is effective or that my feature worksI have added an entry inCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.