Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

more performance #6795

Unanswered
optrack2 asked this question in Q&A
Feb 19, 2024 · 10 comments
Discussion options

I have an application that uses OSMR, however I would like to ask some questions regarding memory consumption and optimization.
To do the routing with more than 200 points is taking more than 12 minutes, there is a way to make it faster regardless of the amount of resources that need to be used.
And regarding memory consumption, I have 12GB of RAM available that I added later to the compilation, however the application is limited to 8GB, is there any way to increase this?

You must be logged in to vote

Replies: 10 comments

Comment options

OSRM is the performance monster out there. Sounds more like you have smth mis-configured.

Best to share a lot more details, e.g. platform, commands to run OSRM, graph extent, endpoint (route/table?), what's the approx average distance between locations etc.?

12 mins could be the case for 200 thousand locations. "The application" (assuming you're not talking about docker but osrm-*) has no hard-coded memory limit. It loads whatever the graph size statically and dynamically whatever is needed to do the expansion (quite low). So the 8GB is probably the graph. But again, impossible to guess what's going on without more details.

You must be logged in to vote
0 replies
Comment options

@nilsnolde There are several different regions of Brazil, some points can be more than 2000 kilometers between them. I executed the same commands as in the documentation to run using cmake, and made the request for standard port 5000 via GET passing the coordinates
Below is an example object before assembling the request to be more specific, but when I assemble a request with more than 200 points I am having this problem with the slowness of routing.

{
"latitude": -26.0922364,
"longitude": -51.6166878,
"region": 0,
},
{
"latitude": -28.9216045,
"longitude": -50.1799525,
"region": 0,
},
{
"latitude": -24.4931997,
"longitude": -46.9945173,
"region": 0,
},
{
"latitude": -26.9195567,
"longitude": -48.0988025,
"region": 0,
},

You must be logged in to vote
0 replies
Comment options

/route or /table? not super familiar with osrm, but a many:many table shouldn't have a problem with that. a route with > 200 waypoints, where lots of them have multiple thousand km apart is a different story as that happens sequentially. still, 12 mins even valhalla would beat in that scenario very likely, so smth strange is going on there.

are you saying that up to 200 waypoints it's quick and above that performance suddenly breaks down?

also what's that "region"? are you splitting osm data? i.e. you're not building entire brazil but island-ish regions of it in a single graph? are you sure connectivity/topology is properly preserved?

You must be logged in to vote
0 replies
Comment options

@nilsnolde
Route

As a rule, no, as more points are added, it grows exponentially, I used it from 200 points onwards, as that's when it starts to get really bad for the user. 35 waypoints take approximately 15 seconds, 90 waypoints take just over a minute, 150 waypoints take approximately 4 minutes, and 200 waypoints take approximately 12 minutes.
Regarding the region, I don't go to OSMR, I've already downloaded the complete Brazil map, so there's no need to divide and group again.

I put it to route 350 points, and it doesn't exceed 8GB, even so it's taking a long time.
Screenshot from 2024年02月19日 15-19-00

You must be logged in to vote
0 replies
Comment options

the last thing that comes to my mind is possibly that it's using excessive swapping for some reason. anything else running on that machine? 12 gb should be plenty for brazil which has 1.6 gb PBF.

what's the output of grep '^Swap' /proc/meminfo? if there's smth in there, then: when you start the osrm executable, look up its PID (process ID) and then monitor what it's using on swap file while processing one of those big requests with grep VmSwap /proc/<PID>/status.

You must be logged in to vote
0 replies
Comment options

if there's no clue there, I give up:) but there's many others here with tons of more experience/knowledge on osrm.

You must be logged in to vote
0 replies
Comment options

@nilsnolde

I listed the commands while it is doing the routing

root@srv-OSRM:~# grep '^Swap' /proc/meminfo
SwapCached: 0 kB
SwapTotal: 4096000 kB
SwapFree: 4096000 kB

root@srv-OSRM:~# grep VmSwap /proc/359/status
VmSwap: 0 kB
No problem, it's something I'm starting to tinker with now too

You must be logged in to vote
0 replies
Comment options

@optrack2 Can you supply an example URL that someone can use to try to reproduce the issue?

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

@optrack2 If you does not need all the route details at this computation step. Just use the table API en point, aka matrix. It is matter of seconds, or less.

https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#table-service

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Converted from issue

This discussion was converted from issue #6790 on March 03, 2024 17:54.

AltStyle によって変換されたページ (->オリジナル) /