-
Notifications
You must be signed in to change notification settings - Fork 835
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
Engine Thread Pool Configuration #1490
Comments
Thanks. Yes would be great to add a PR for this. |
@nickdgriffin we are having similar issue with the service orchestrator hanging requests. Could you please share how you solve the problem by configuring JAVA_OPTS? thank you! |
@amigniox Yes, that would have been helpful - I've edited the original post to show how we did it. |
Thanks @nickdgriffin this solved the issue |
Hello!
Long time browser, first time raiser. We recently ran into an issue where making more than one request concurrently to the predictions endpoint of the Engine would result in all requests hanging indefinitely.
It turned out to be a combination of the complexity of our graph (max depth of 7) and the fact that the Engine is using Spring's default configuration for the thread pool which has an unbounded queue but a core pool size of 8. This results in only 8 threads being spawned and tasks being queued indefinitely, which in our case would cause a blockage due to the fact that the PredictiveUnitBean blocks the thread whilst it waits for the child. As one thread is taken up by the GRPC server, the other 7 are required for a single request to complete and any additional threads cause a lock up - although it's not reported as a deadlock, and as the queue is unbounded there are no task rejections being reported.
My request is that these properties are exposed or documented so that they can be configured - at the moment we've resorted to setting them via JAVA_OPTS - or that more sensible defaults are set along with logging around when it is unable to process as all we could see was the REST controller logging the request and nothing else. We had to inspect the heap and perform a thread dump to see what was happening under the hood.
Alternatively, PredictiveUnitBeans shouldn't block the thread until the child completes as this will create issues for larger graphs that will require even larger thread pools to be able to support their operation whilst becoming more susceptible to lock up.
Thanks,
Nick
EDIT:
We applied the JAVA_OPTS changes with the following annotation on the SeldonDeployment resource (it's actually done via a Helm chart in our case, so we can configure those pool values):
The pool values were based on:
There's room for tuning, but it was adequate for what we needed. Keep an eye on memory utilisation when tuning the pool too, as you might need to allocate more.
The other values were taken from the defaults that are applied, as it seems this annotation overwrites them.
The text was updated successfully, but these errors were encountered: