<div dir="ltr">Patrick,<div><br></div><div> There are about a million possible paths you could take here, a lot of it will depend on what skills you have available. Off the top of my head:</div><div><br></div><div> 1) Speed things up by avoiding HTTP overhead and calling the libosrm.a functions directly instead of hitting `osrm-routed` over HTTP</div><div> 2) Modify the OSRM C++ source code and strip out the parts of the map-matching response you don't need</div><div> 3) Simplify your trace geometries to speed up map-matching</div><div> 4) Break your trace list into sets and run these on multiple machines in parallel (make copies of the OSRM data onto multiple machines)</div><div> 5) Just wait 10 hours, and get a good nights sleep</div><div><br></div><div> libosrm.a is thread-safe, so if you're calling functions from threads you can do many at once.</div><div><br></div><div> osrm-routed is multi-threaded, so you can run many queries in parallel - how many will depend on how many CPUs your machine has. Profiling multi-threaded server performance is kind of beyond the scope of OSRM itself, there is lots of literature on it.</div><div><br></div><div>daniel</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 11, 2018 at 10:57 AM, Patrick Agin <span dir="ltr"><<a href="mailto:agin.patrick@gmail.com" target="_blank">agin.patrick@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sorry for the newbie question but what's the difference between osrm-routed and libosrm? Is it mandatory to use the latter for a parallel usage? And do you have an example of code that does the calls in parallel threads? Thanks Sasha for your help.<span class="m_2748391558276587051HOEnZb"><font color="#888888"><div>Patrick</div></font></span></div><div class="m_2748391558276587051HOEnZb"><div class="m_2748391558276587051h5"><div class="gmail_extra"><br><div class="gmail_quote">2018-05-11 13:50 GMT-04:00 Sasha Khapyorsky <span dir="ltr"><<a href="mailto:sashakh@gmail.com" target="_blank">sashakh@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Patrick,<br>
<br>
If you are using libosrm (which reported to be thread safe:<br>
<a href="https://github.com/Project-OSRM/osrm-backend/issues/4966" rel="noreferrer" target="_blank">https://github.com/Project-OSR<wbr>M/osrm-backend/issues/4966</a>) you can just<br>
split your list and run its parts in different parallel threads.<br>
<span class="m_2748391558276587051m_-5096805594716834079HOEnZb"><font color="#888888"><br>
Sasha<br>
</font></span><div class="m_2748391558276587051m_-5096805594716834079HOEnZb"><div class="m_2748391558276587051m_-5096805594716834079h5"><br>
On Fri, May 11, 2018 at 8:14 PM, Patrick Agin <<a href="mailto:agin.patrick@gmail.com" target="_blank">agin.patrick@gmail.com</a>> wrote:<br>
> Hi,<br>
> I want to call the map matching service for nearly a million of routes. I<br>
> calculated that the task could take 10 hours on my laptop to complete. I was<br>
> wondering if there's someone who faced the same problem and who addressed it<br>
> in parallel, maybe with Spark? Another tool or way?<br>
> Any hint is greatly appreciated!<br>
> Patrick<br>
><br>
</div></div><div class="m_2748391558276587051m_-5096805594716834079HOEnZb"><div class="m_2748391558276587051m_-5096805594716834079h5">> ______________________________<wbr>_________________<br>
> OSRM-talk mailing list<br>
> <a href="mailto:OSRM-talk@openstreetmap.org" target="_blank">OSRM-talk@openstreetmap.org</a><br>
> <a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank">https://lists.openstreetmap.or<wbr>g/listinfo/osrm-talk</a><br>
><br>
<br>
______________________________<wbr>_________________<br>
OSRM-talk mailing list<br>
<a href="mailto:OSRM-talk@openstreetmap.org" target="_blank">OSRM-talk@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank">https://lists.openstreetmap.or<wbr>g/listinfo/osrm-talk</a><br>
</div></div></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
OSRM-talk mailing list<br>
<a href="mailto:OSRM-talk@openstreetmap.org" target="_blank">OSRM-talk@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank">https://lists.openstreetmap.or<wbr>g/listinfo/osrm-talk</a><br>
<br></blockquote></div><br></div></div>