Dima calculation with multiple xTour workers
Posted: Wed Apr 21, 2021 11:40 am
Hello,
For one of our clients, we need to be able to perform calculations simultaneously, the client works as B2C, so we have a large number of delivery locations, typically each TransportOrder has a new location as its destination, we have cases with 500 TransportOrders in the same request.
So, taking this into consideration, we have requests that are taking more than 15 mins, when debugging, we noticed that most of the time is spent for the construction of the DistanceMatrix.
Our server is made up of 1 xTour server, with 4 workers, this helped us perform 4 simultaneous requests but as a downside we are facing a problem with the Dima calculation.
We noticed that all 4 instances are using the same Dima file on the disk, so when we tried to conserve the Dima (deleteAfterUsage and deleteBeforeUsage parameters set to False), and using the same Dima when planning with the same speed profiles, we had a problems such as “(Reason: Could not calculate distance table for Dima with ID 1). Engine error: Dima locked”.
So, my question is:
- Is it possible to allow several instances to use the same Dima simultaneously without having the Dima locked issue?
- If not, is there any way to multiply the Dima on the 4 workers (each worker uses its own Dima)?
- If not, what do you suggest as a solution for our problem, taking into consideration that we need to be able to have simultaneous requests and minimize the time spent to construct the Dima?
Thanks in advance
Ibrahim
For one of our clients, we need to be able to perform calculations simultaneously, the client works as B2C, so we have a large number of delivery locations, typically each TransportOrder has a new location as its destination, we have cases with 500 TransportOrders in the same request.
So, taking this into consideration, we have requests that are taking more than 15 mins, when debugging, we noticed that most of the time is spent for the construction of the DistanceMatrix.
Our server is made up of 1 xTour server, with 4 workers, this helped us perform 4 simultaneous requests but as a downside we are facing a problem with the Dima calculation.
We noticed that all 4 instances are using the same Dima file on the disk, so when we tried to conserve the Dima (deleteAfterUsage and deleteBeforeUsage parameters set to False), and using the same Dima when planning with the same speed profiles, we had a problems such as “(Reason: Could not calculate distance table for Dima with ID 1). Engine error: Dima locked”.
So, my question is:
- Is it possible to allow several instances to use the same Dima simultaneously without having the Dima locked issue?
- If not, is there any way to multiply the Dima on the 4 workers (each worker uses its own Dima)?
- If not, what do you suggest as a solution for our problem, taking into consideration that we need to be able to have simultaneous requests and minimize the time spent to construct the Dima?
Thanks in advance
Ibrahim