Page 1 of 1
High Performance Routing with xRouteServer
Posted: Thu Mar 23, 2017 5:30 pm
by daxbin
Hi,
I'd like to test high performance routing (HPR).
Therefore I did a setup of the two (built in) profiles
carfast and
carslow for
- xdima-x64-1.22.0.3 and
- xroute-x64-1.22.0.0 servers.
For
carfast I created a high performance routing network file with the
routingnetworkgenerator tool.
Then I have calculated a 625×625 dima
- once with xDima.calculateDistanceTable and
- once with xRoute.calculateMatrixInfo
which both should be benefit from available HPR network files as one can read in the docs.
More accurately I used the asynchronous way of invoking the calculation (e.g.
startCalculateMatrixInfo).
I've got the following results:
Code: Select all
xServer Profile HPR Size-X Size-Y --Time
xDima carfast × 625 625 1,8 s
xDima carslow – 625 625 39,0 s
xRoute carfast × 625 625 43,2 s
xRoute carslow – 625 625 42,2 s
While
xDima shows a significant difference in the calculation time, this is not visible when using
xRoute.
I already checked:
- The maps.highPerformanceRoutingNetworkDir is set both in xdima.properties and xroute.properties.
- The routing is not dynamic in the sense that no RoutingOptions or VehicleOptions are set neither for the whole route or for single waypoints nor a ProfileXMLSnippet is set in the CallerContext.
- In the logs there was nothing special.
- The license.ptv has both
- xroute.highPerformanceRouting=true and
- xdima.highPerformanceRouting=true.
Is there still something I could check, so that HPR also works with
xRouteServer?
Birk
Re: High Performance Routing with xRouteServer
Posted: Thu Mar 23, 2017 6:18 pm
by daxbin
After raising log level from INFO to DEBUG (like mentioned in Troubleshooting section of the docs) I found
Code: Select all
2017-03-23 19:09:49,891;DEBUG;com.ptvag.xserver.module.xroute.m0001;ad475935-6c52-495d-aac9-942cb144ba39;;;;High-performance routing cannot be used due to incompatible routingOptions, vehicleOptions, or waypoints. Use conventional routing instead.
in the log which I have to further investigate in.
Re: High Performance Routing with xRouteServer
Posted: Thu Mar 23, 2017 7:47 pm
by daxbin
Next step was to investigate the (simplified to a 2×2 dima) request
Code: Select all
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns4:calculateMatrixInfo xmlns:ns4="http://types.xroute.xserver.ptvag.com">
<ns4:ArrayOfWaypointDesc_1>
<ns3:WaypointDesc xmlns:ns3="http://xroute.xserver.ptvag.com" linkType="NEXT_SEGMENT" fuzzyRadius="0">
<ns3:wrappedCoords>
<ns1:Point xmlns:ns1="http://common.xserver.ptvag.com">
<ns1:point x="1350000.0000000002" y="5100000.000000001" z="0.0" />
</ns1:Point>
</ns3:wrappedCoords>
<ns3:wrappedSegmentID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
</ns3:WaypointDesc>
<ns3:WaypointDesc xmlns:ns3="http://xroute.xserver.ptvag.com" linkType="NEXT_SEGMENT" fuzzyRadius="0">
<ns3:wrappedCoords>
<ns1:Point xmlns:ns1="http://common.xserver.ptvag.com">
<ns1:point x="1350000.0000000002" y="5100250.000000001" z="0.0" />
</ns1:Point>
</ns3:wrappedCoords>
<ns3:wrappedSegmentID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
</ns3:WaypointDesc>
<ns3:WaypointDesc xmlns:ns3="http://xroute.xserver.ptvag.com" linkType="NEXT_SEGMENT" fuzzyRadius="0">
<ns3:wrappedCoords>
<ns1:Point xmlns:ns1="http://common.xserver.ptvag.com">
<ns1:point x="1350250.0000000002" y="5100000.000000001" z="0.0" />
</ns1:Point>
</ns3:wrappedCoords>
<ns3:wrappedSegmentID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
</ns3:WaypointDesc>
<ns3:WaypointDesc xmlns:ns3="http://xroute.xserver.ptvag.com" linkType="NEXT_SEGMENT" fuzzyRadius="0">
<ns3:wrappedCoords>
<ns1:Point xmlns:ns1="http://common.xserver.ptvag.com">
<ns1:point x="1350250.0000000002" y="5100250.000000001" z="0.0" />
</ns1:Point>
</ns3:wrappedCoords>
<ns3:wrappedSegmentID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
</ns3:WaypointDesc>
</ns4:ArrayOfWaypointDesc_1>
<ns4:ArrayOfWaypointDesc_2>
<ns3:WaypointDesc xmlns:ns3="http://xroute.xserver.ptvag.com" linkType="NEXT_SEGMENT" fuzzyRadius="0">
<ns3:wrappedCoords>
<ns1:Point xmlns:ns1="http://common.xserver.ptvag.com">
<ns1:point x="1350000.0000000002" y="5100000.000000001" z="0.0" />
</ns1:Point>
</ns3:wrappedCoords>
<ns3:wrappedSegmentID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
</ns3:WaypointDesc>
<ns3:WaypointDesc xmlns:ns3="http://xroute.xserver.ptvag.com" linkType="NEXT_SEGMENT" fuzzyRadius="0">
<ns3:wrappedCoords>
<ns1:Point xmlns:ns1="http://common.xserver.ptvag.com">
<ns1:point x="1350000.0000000002" y="5100250.000000001" z="0.0" />
</ns1:Point>
</ns3:wrappedCoords>
<ns3:wrappedSegmentID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
</ns3:WaypointDesc>
<ns3:WaypointDesc xmlns:ns3="http://xroute.xserver.ptvag.com" linkType="NEXT_SEGMENT" fuzzyRadius="0">
<ns3:wrappedCoords>
<ns1:Point xmlns:ns1="http://common.xserver.ptvag.com">
<ns1:point x="1350250.0000000002" y="5100000.000000001" z="0.0" />
</ns1:Point>
</ns3:wrappedCoords>
<ns3:wrappedSegmentID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
</ns3:WaypointDesc>
<ns3:WaypointDesc xmlns:ns3="http://xroute.xserver.ptvag.com" linkType="NEXT_SEGMENT" fuzzyRadius="0">
<ns3:wrappedCoords>
<ns1:Point xmlns:ns1="http://common.xserver.ptvag.com">
<ns1:point x="1350250.0000000002" y="5100250.000000001" z="0.0" />
</ns1:Point>
</ns3:wrappedCoords>
<ns3:wrappedSegmentID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
</ns3:WaypointDesc>
</ns4:ArrayOfWaypointDesc_2>
<ns4:ArrayOfRoutingOption_3>
<ns3:RoutingOption xmlns:ns3="http://xroute.xserver.ptvag.com" parameter="ROUTE_LANGUAGE" value="EN" />
</ns4:ArrayOfRoutingOption_3>
<ns4:MatrixOptions_4 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
<ns4:CallerContext_5>
<ns2:wrappedProperties xmlns:ns2="http://baseservices.service.jabba.ptvag.com">
<ns2:CallerContextProperty value="carfast" key="Profile" />
<ns2:CallerContextProperty value="PTV_GEODECIMAL" key="CoordFormat" />
<ns2:CallerContextProperty value="PLAIN" key="ResponseGeometry" />
</ns2:wrappedProperties>
</ns4:CallerContext_5>
</ns4:calculateMatrixInfo>
</soap:Body>
</soap:Envelope>
which leads to mentioned log entry and play a little with it.
And et voilà the passage
Code: Select all
<ns4:ArrayOfRoutingOption_3>
<ns3:RoutingOption xmlns:ns3="http://xroute.xserver.ptvag.com" parameter="ROUTE_LANGUAGE" value="EN" />
</ns4:ArrayOfRoutingOption_3>
is the evil part.
After removing this relict from earlier experiments with
xRoute now I got in the log:
Code: Select all
2017-03-23 20:32:31,618;DEBUG;com.ptvag.xserver.module.xroute.m0001;2792330f-7b14-4b8a-971d-994a3721c3d9;;;;Load high-performance routing network from the following file: <path-to-hpr-network-files>/carfast.chData
Re: High Performance Routing with xRouteServer
Posted: Fri Mar 24, 2017 7:04 am
by Bernd Welter
Hello Birk,
thanks for the deep drill into the topic!
What was the final computation time for xRoute+carFast(HPR)?
Best regards Bernd
Computing times for xRouteServer with HPR
Posted: Mon Mar 27, 2017 12:28 pm
by daxbin
Hello Bernd,
now the times are
Code: Select all
xServer Profile HPR Size-X Size-Y --Time
xDima carfast × 625 625 1,8 s
xDima carslow – 625 625 39,0 s
xRoute carfast × 625 625 7,8 s
xRoute carslow – 625 625 42,2 s
which is satisfying for
xRoute too.
BTW, the important point for me were not absolute numbers but to get
HPR running which should lead to a significant reduction in the computing time.
Best regards, Birk
Re: High Performance Routing with xRouteServer
Posted: Mon Mar 27, 2017 1:09 pm
by Bernd Welter
Just for your info:
There's a bugfix in xRoute 1.24.0.0:
„Fixed configuration switch to load high-performance routing networks on startup.”
So this might again speed up the calculation
Re: High Performance Routing with xRouteServer
Posted: Mon Mar 27, 2017 1:17 pm
by Joost
Please do keep in mind:
The xRoute.calculateMatrixInfo call returns all the relations within the response. This means a lot of elements that have to be serialized. xDima.calculateDistanceTable returns just void when it is done, which is a lot faster to serialize. If you compare the 2 calls, there will always be an overhead difference because of this.
Re: High Performance Routing with xRouteServer
Posted: Mon Mar 27, 2017 1:33 pm
by Bernd Welter
sure!
to check this you could take a look at the internal module time in the RequestTimes of the logs
Anyhow: if the user requires the complete info on clientside he would have to wait the 7.8seconds
or to use xDima's 1.8 seconds PLUS all the getDistPeriod-calls which would then raise additional time.
STRIKE!
I used (asynchronous) xRoute.startCalculateMatrixInfo
Posted: Mon Mar 27, 2017 8:29 pm
by daxbin
Hello Joost,
I have tried
not to consider the transfer time of the relations from the
xServer to the client.
My explanation for
Code: Select all
xServer Profile HPR Size-X Size-Y --Time
xDima carfast × 625 625 1,8 s
xDima carslow – 625 625 39,0 s
xRoute carfast × 625 625 7,8 s
xRoute carslow – 625 625 42,2 s
the difference between
xDima and
xRoute was not the transfer time of the relations within the response because I did
not use
synchronous call
xRoute.calculateMatrixInfo.
Instead, like mentioned in my first post
More accurately I used the asynchronous way of invoking the calculation (e.g. startCalculateMatrixInfo).
I used the
asynchronous invocation in both cases for
xDima and
xRoute.
My assumption was that even in the way of asynchronous invocation the
xRoute has to save the result in the job (so that client can fetch it later) which may be less efficient than
xDima's way of storing relations. But its just an assumption.
Best regards, Birk
Edit: Just as an addition: Client and server are 100 KiB/s (speed) and 30 ms (ping) apart.
Edit2: @Bernd: Looking into server logs I can see only 2.5 seconds for
xRoute. No idea where the rest of the 7.8 seconds is consumed. Perhaps there is an issue in my client which isn't easy to reason about.