ESQL arrow parser in worker thread#62
Open
crespocarlos wants to merge 7 commits into
Open
Conversation
0653f75 to
53acd47
Compare
53acd47 to
563c2a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sequenceDiagram box Kibana Server participant Main Thread participant Worker Thread end Main Thread-->>Main Thread: esClient.search({format: 'arrow'}) Main Thread->>Worker Thread: apache-arrow response Worker Thread-->>Worker Thread: tableFromIPC(response) Worker Thread-)Main Thread: SharedArrayBuffer opt decode on the server? Main Thread->>Main Thread: decode SharedArrayBuffer endTests
Simulating 10 concurrent clients calling an endpoint for 10s
Thread Pool config:
{ minWorkers: 1, maxWorkers: 20, idleTimeout: 500, concurrentTasksPerWorker: 1 }Memory footprint
Without workers
Worker code with babel
Worker code with babel
Worker code transpiled
Worker code transpiled (Passing arrow object directly to worker thread)
Worker code transpiled (response streamed to worker thread)
Worker memory consumption
With babel
[2025-04-11T11:18:14.264+02:00][INFO ][worker-threads-service] Worker 5 stats: {"heapTotal":"167.34","heapUsed":"126.99","totalTime":113.79720799998904}Transpiled
[2025-04-11T09:59:24.532+02:00][INFO ][worker-threads-service] Worker 20 stats: {"heapTotal":"47.30","heapUsed":"22.11","totalTime":253.90104100000462}Main thread highest RSS: 2.61gb; Delta: 2.61gb (end) - 1.54gb (start) - 1.09gb
Streaming data to worker thread
[2025-04-17T09:45:54.263+02:00][INFO ][worker-threads-service] Worker 5 stats: {"heapTotal":"45.55","heapUsed":"18.59","totalTime":8.242832999996608}Throughput
Simulating 10 concurrent clients calling an endpoint for 10s - each running 50 queries:
"FROM traces* | LIMIT 1000". Running against pure JS worker threads code.Passing arrow object directly to worker thread
Streaming arrow object to worker thread
Some observations