Earlier quoted context omitted.
PSA: Open Source Routing Machine (OSRM) was largely abandoned by its maintainers. Several of us are working to reboot it, so if you enjoy map data and/or graph theory and have C++ skills, this would be a great project to work on. https://github.com/Project-OSRM/osrm-backend/ (Reboot discussion at https://github.com/Project-OSRM/osrm-backend/issues/5209 )
That issue links to another open source routing engine for OSM (Valhalla) that is actively developed, what are the strengths of each?
The principal downside is that the routing graph takes a lot of time and memory to prepare; runtime RAM usage is also high, though not so much. I think there's some potential for reducing its memory footprint.
Valhalla builds on the older A* algorithm, so it's not so fast (or memory-hungry), though it does make some use of hierarchies to shorten query time. Graphhopper is another, featureful routing engine designed for use with OSM data (written in Java).