Reputation: 37
I know optaplanner scales very well wrt problem size. But how can it scale wrt the number of problem requests? Currently, we have exposed optaplanner as a REST service. It can get hundreds of scheduling requests per day. Search is stopped after 10 seconds. This means that at some peaks there are several scheduling requests in the queue. What could we do to parallelize the requests on multiple machines?
Upvotes: 3
Views: 1063
Reputation: 27312
All low-level support for a multi-tenant setup (on a cluster) is available:
SolverFactory
is thread safe, 1 per nodeSolver
per thread per node. Because a single Solver
hogs a single Thread
(it does not do any IO, unlike web requests etc), I recommend against running more Solvers than there are Threads.Solver.terminateEarly()
is thread-safe and can be called on all Solvers
if the node is exiting.However, there is no high-level support for a multi-tenant setup yet. So you 'll need to build that yourself:
ExecutorService
with the size of the number of CPU cores should suffice for this. Simply submit the requests as Future
's. Build the Solver in the Future. Build the SolverFactory at bootstrap.terminateEarly()
can help in this regard.ExecutorService
.We 'll build high-level support in the future. Please add your requirements in this jira issue.
Upvotes: 3