Hello,
I need to use xTour in a multitask approach. So, I would like to have several processes "xTour.planBasicTours" working at same time.
In order to achieve this, on properties file of xTour (Xtour.properties) I increased the number of module instances to 4.
ex:
# The number of module instances to be started as background processes.
poolSize=4
Then, when I make more than one request of xTour.planBasicTours at the same time I get the following error:
2014-09-19 10:16:41,988;ERROR;com.ptvag.xserver.module.xtour.m0001;ed1c2dca-c443-4550-b9f6-7289297b9045;;;;Could not plan basic tours (Reason: Could not delete dima (before usage)). Engine error: Dima is in use by another process (code: -1008).
However, everything works perfect if I chose not to use the array of distance matrices (by setting the directVelocity value on planning parameters).
The problem is that in this case, I need to have the plan results with different driving speeds, according to the road type or location (ex: city or highway).
Can you please help me on this? Thank you.
Increasing xTour poolSize. How to prevent Dima conflicts?
- Bernd Welter
- Site Admin
- Posts: 2703
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: Increasing xTour poolSize. How to prevent Dima conflicts
Hello Pedro,
the situation you describe is in fact raised by the concurrent access to the Distance Matrices at the same time.
Of course setting the poolsize to 1 is not really a good option because it would limit the throughput to a value that is not required in case of independent distance matrices.
So the next important question is "what is the scope of the concurrent plannings?"
Is it necessary to reuse the existing distance matrix or is it an option to create independent DIMA IDs for the planning calls?
Kind regards from Germany,
Bernd
the situation you describe is in fact raised by the concurrent access to the Distance Matrices at the same time.
Of course setting the poolsize to 1 is not really a good option because it would limit the throughput to a value that is not required in case of independent distance matrices.
So the next important question is "what is the scope of the concurrent plannings?"
Is it necessary to reuse the existing distance matrix or is it an option to create independent DIMA IDs for the planning calls?
Kind regards from Germany,
Bernd
Re: Increasing xTour poolSize. How to prevent Dima conflicts
Hello Bernd,
Thank you for your quick reply. Solved my problem.
I was deleting the existing distance matrix on every call (DistanceMatrixByRoad.deleteBeforeUsage=true), but on all requests I was always using the same dimaID.
Now I’m generating different ID’s for each call and it is working fine. Thank you.
Best regards,
Pedro Diogo
Thank you for your quick reply. Solved my problem.
I was deleting the existing distance matrix on every call (DistanceMatrixByRoad.deleteBeforeUsage=true), but on all requests I was always using the same dimaID.
Now I’m generating different ID’s for each call and it is working fine. Thank you.
Best regards,
Pedro Diogo
- Bernd Welter
- Site Admin
- Posts: 2703
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: Increasing xTour poolSize. How to prevent Dima conflicts
Another player asked almost the same question and therefore I'd like to add some more lines here.
Depending on your usecase and the available fleet you may approach the DIMAs in various strategies which refers to DIMA IDs but also to the well known "deleteBefore" and "deleteAfter" parameters.
If possible try to identify the "indepencence scope" of the distance matrices. Here are some samples:
Depending on your usecase and the available fleet you may approach the DIMAs in various strategies which refers to DIMA IDs but also to the well known "deleteBefore" and "deleteAfter" parameters.
If possible try to identify the "indepencence scope" of the distance matrices. Here are some samples:
- a DIMA per dispatcher? If a dispatcher doesn't generate several plannings at the same time ..
- a DIMA per individual vehicle? OK, this might increase the number of DIMAs in your system - maybe not worth to be the price to avoid conflicts
- a DIMA for each planning - maybe a good approach if applied together with deleteBefore=TRUE / deleteAfter=TRUE.
- to be completed
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...
Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...
- Bernd Welter
- Site Admin
- Posts: 2703
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: Increasing xTour poolSize. How to prevent Dima conflicts
By the way: in the meantime the mechanism of HIGH PERFORMANCE ROUTING has been implemented. This mechanism enables a server to speed up the distane matrix caalculation under certain circumstances.
This mechanism is so fast that it could be the proper approach to calculate the DIMA on the fly whenever you need it.
Here are some more facts about the incredible speed of HPR:
xDima / xTour 1
xDima 2
Definetly worth being checked...
Bernd
This mechanism is so fast that it could be the proper approach to calculate the DIMA on the fly whenever you need it.
Here are some more facts about the incredible speed of HPR:
xDima / xTour 1
xDima 2
Definetly worth being checked...
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...
Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...