Page 1 of 1

Increasing xTour poolSize. How to prevent Dima conflicts?

Posted: Mon Nov 03, 2014 9:49 am
by pssdiogo
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.

Re: Increasing xTour poolSize. How to prevent Dima conflicts

Posted: Tue Nov 04, 2014 5:07 pm
by Bernd Welter
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?
As you can see with this status monitor image it is possible to use two independent DIMA IDs in parallel while the third one is in the queue.<br /><br />My poolsize is two of course
As you can see with this status monitor image it is possible to use two independent DIMA IDs in parallel while the third one is in the queue.

My poolsize is two of course
Kind regards from Germany,
Bernd

Re: Increasing xTour poolSize. How to prevent Dima conflicts

Posted: Wed Nov 05, 2014 4:00 pm
by pssdiogo
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

Re: Increasing xTour poolSize. How to prevent Dima conflicts

Posted: Mon Jul 11, 2016 2:59 pm
by Bernd Welter
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:
  • 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
Best regards Bernd

Re: Increasing xTour poolSize. How to prevent Dima conflicts

Posted: Tue Mar 02, 2021 8:21 am
by Bernd Welter
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