-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSM routing solution #11
Comments
What it seems to me from this dependency graph, it uses
Therefore I would say parking depends on osrm-car, ppr and nigiri.
I think it would be nice to enable more people working on the GTFS-pipeline. However, wouldn't it also be an option to not completely disable the modules, but instead (for now) only import parts of Europe as OSM data? This would allow to gain further insights in the requirements for importing (e.g. how many countries could we already import with the current setup), unblock the work on the GTFS-pipeline and would still allow for intermodal routing in some areas (e.g. in those were there are already maintainers for feeds or where additional interesting data like GBFS is available) which is also nice to test the new client implementations.
This would also be a nice option, but in my opinion depends on which funding is available. Is there any currently?
This would be awesome due to the following:
OSM Data of the whole world is not even three times the amount of Europe and a look on the map of transit.land of available feeds indicates similarly for GTFS data. And this would enable a bunch of new interesting options. I would go for what I described in regard to (1) and would see if we can find someone to work on (2) and (3) in the meantime. |
That's good in the sense that it's apparently not as performance-sensitive as
Right, a smaller subset is also an option, but that would be a temporary setup only then, not a viable final state IMHO.
For now everything we use is made available to us for free, there is no immediately available funding/budget. Knowing exactly what we'd need would probably help with finding some. Also useful would be finding ways to verify this will work at minimal cost, e.g. on suitable hardware somebody happens to have temporary access to, a short term rented VM (assuming those can be obtained with sufficient RAM/storage at reasonably low cost), or finding people maintaining such setups elsewhere (OSM seems to have global OSRM routing on their website for example).
Let's be careful to not raise the expectations even further ;-) I have no idea how MOTIS would behave when faced with hundreds of totally disconnected networks for example. Valhalla does have a few other points that do look relevant besides the more efficient import (and thus update), like detailed configurable profiles without needing a database rebuild (to be verified if those reach the same quality as |
What requirements exist for the routing? I use Graphhopper in a few projects and am very happy with it, regarding performance, profiles and memory consumption. |
That's basically option (4) then: Implement an entirely new OSM routing integration for MOTIS. That's more work but probably not prohibitively expensive either, following what's already there for OSRM/Valhalla. I haven't really looked deeply enough into the implementation to know the requirements from MOTIS on that level though. |
It could be an option to use a more generic routing API like https://github.com/gis-ops/routingpy as basis. Doing so would allow to switch the routing backend anytime later... |
Is there any routing solution that can work with OSM delta updates like this? Regarding the integration of new routing services, I was thinking a bit about since some months now. This is what I came up with. It also would solve a lot of nitpicks I currently have with MOTIS as it is now (like really old Flatbuffers version and the fact that there's no distinction between internal and external APIs hence no API versioning/stability). I was also thinking about a more generic API or basically a new architecture for MOTIS: In contrast to the monolithic architecture of MOTIS, this would be service based. So the orchestrator service could be written in any programming language (my favorite would be Rust). The other routing services (mainly for first mile + last mile) could be addressed via a load-balancer reverse-proxy or directly.
This way, the expensive OSRM part is needed only once (requests need maybe 10-20% CPU from OSRM and the rest is in Basically, this architecture would eliminate MOTIS as it is now and would therefore be "MOTIS 2.0". The communication protocol between the intermodal orchestrator and the street routing services could be standardized. Then:
This would bring a lot more scalability, extensibility and flexibility. |
Making the routing part swappable sounds great! I would appreciate if the new architecture would still be simple enough to be able to run outside docker, since I basically can not use docker in the environment the current Transitous (development) instance is running in. As far as I understand the current architecture, all communication between modules already goes through flatbuffers, which should in principle allow things like splitting out modules into a new process dynamically with a config option, since you can easily serialize / deserialize the communication between them already. Whether the different modules are then implemented as shared libraries that can be either loaded in the main process or in a separate runner, or whether always the same executable is launched with different options is then an implementation detail. You could still use different programming languages fairly easily, as pretty much all of them can call C, and when you are serializing everything already, you can easily pass data across this boundary. |
Yes, we already have some code for remote operations, e.g. here: That's also one reason why we have our own (stackful) coroutine library (written when C++ didn't have language support for coroutines): So MOTIS with its current architecture is prepared to scale to multiple servers. Add a websocket load balancer in between plus maybe an auto-scaling mechanism from one of the big cloud vendors, and you're almost there. However, not having to maintain all this would also have some benefits :-) I guess everything that can be started with Docker/Podman/etc. can also be run standalone. And if the orchestrator would be written in Rust, it would even be an option to statically link It's not urgent.. so no need to decide anything now. Just wanted to share some ideas :-) |
Recommendation from people at the OSM Hack Weekend in Karlruhe is GraphHopper. Incremental updates are not supported by any engine, GraphHopper is said to be able to do imports on <= 128G RAM and without SSDs for the full planet. Valhalla would be the second choice due to sub-optimal results over longer distances when crossing routing tile boundaries (as we mostly do short-distance routing that might be less of an issue for us though). OSRM is said to not be viable on realistic hardware (needs >=512G RAM). |
There's multiple different OSM-based routing modules in MOTIS:
osrm
(with foot, bike and car profile)ppr
parking
(does that actually route itself or delegate toosrm-foot
/ppr
?)Those are used from other modules:
nigiri
can use either one of those for enabling intermodal routinggbfs
depends onosrm-foot
explicitly (as that's faster thanppr
, althoughppr
would produce equally usable results)parking
depends on ???And there's issues with those:
osrm
,ppr
andparking
fail to import the full European dataset, running out of memory.osrm-foot
is significantly faster thanppr
(therefore used bygbfs
) butppr
has the better results due to supporting profiles (and thus preferred for walking routes), but both use distinct databases and thus having both significantly increase the data import cost.parking
is even more expensive to importosrm
andppr
, see Random expensive intermodal routing requests motis-project/motis#439 (comment).How do we resolve this?
Possible options:
(1) No intermodal routing, disable all of this.
Worst possible outcome IMHO, but can be a useful temporary step to unblock work on the GTFS pipeline while this issue is investigated.
(2) Make OSRM/PPR import work
At this point this would likely mean obtaining large high speed SSD storage and enable swapping. OSRM documentation suggests with a total of 350G a full planet file is importable. We have to consider that this isn't a one-time thing though, there is no support for incremental update. Whether
ppr
andparking
also work with this then is unknown, at leastparking
seemed 3x more RAM-expensive in the local CH test.When done all MOTIS features would become available.
(3) Make Valhalla work as a replacement to OSRM/PPR
This would likely mean development efforts on Valhalla and/or MOTIS. Valhalla seems able to import the full EU dataset with less than 24G RAM (although I/O heavy), so even a full planet import is not unthinkable. Valhalla does have support for foot/bike/car routing and could thus in theory replace
osrm
and possiblyppr
(profile support to be verified).gbfs
doesn't work with Valhalla yet, how that will perform eventually is unknown. And how this impacts/relates toparking
is also unknown.Going this way would enable intermodal routing for foot/bike/car in a first step, while
gbfs
andparking
would probably take longer to become available.The text was updated successfully, but these errors were encountered: