-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
EQL Thread Usage #59708
Comments
After discussing this, we concluded that EQL (and QL in general) should be more careful around what thread it uses. |
I wonder if @elastic/es-core-infra have some recommendations on how we should deal with threads in EQL. |
I think threads and which one to use is a problem we have in many different places. I did some thinking about this recently when introducing a new threadpool for system reads and a lot of times we just throw things into the generic threadpool and call it done :(. Thank you for starting this discussion and thinking about the usage of threads by EQL. In order to provide the most useful input, can the steps be explained a bit more? For example, in terms of mapping merging - what exactly is this doing? What is involved in the plan analysis? |
Thanks for stepping in Jay. In terms of thread usage, EQL currently has 3 main stages:
I think 1 is fine however with 2 I'm concerned the mappings themselves can be a problem. Otherwise, this process from a computation POV is quite fast (we're talking ms here). 3 is the biggest concern since EQL does trigger other queries as it navigates through the data and in case of issues, might be hard to isolate or exacerbate the problem to other areas. |
Thanks for the details Costin.
That said maybe EQL could fit into its own bucket in terms of expense in comparison to other searches. With async_search more slow searches will be executed and there has been consideration that these need some sort of prioritization, see #37867 and there is a mention of EQL by the security team as well. |
Regarding the management thread, we are indeed pulling field capabilities, and then we perform potentially CPU-intensive operation by analyzing pulled fields and formulating search requests and sending them back to the server. It is not blocking. (It also seems that analysis of EQL is less CPU intensive than SQL). |
It sounds like steps 1 and 3 are okay in terms of execution. With a future move to async search, using our own thread-pool for actual search queries might be even less of an issue. |
+1. Moving to a different thread just adds more overhead and we should strive to process this quick and free the memory up sooner rather than later if it is going to add memory pressure. |
I would like to discuss thread usage in EQL. The current situation is this:
transport_worker
thread.management
thread. This is where mapping merging and plan analysis occurs and the search request is formulatedsearch
thread.I think that reusing transport thread for the initial processing is justifiable since we don't do any heavy lifting there, but I am not sure about the second and the thirds steps.
The text was updated successfully, but these errors were encountered: