-
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
Cherry-pick #19562 to 7.x: Use a cache instead of sync.Pool in script processor #19693
Conversation
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)
Pinging @elastic/siem (Team:SIEM) |
❕ Build Aborted
Expand to view the summary
Build stats
Test stats 🧪
Steps errorsExpand to view the steps failures
Log outputExpand to view the last 100 lines of log output
|
Cherry-pick of PR #19562 to 7.x branch. Original message:
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
.