Search code examples
angularosrmleaflet-routing-machine

leaflet-routing-machine OSRM too many requests with status code 429


I have used leaflet-routing-machine with OSRM in it. But server returns too many requests with status code 429 when executing following code

L.Routing.control({
        waypoints: [
            L.latLng(57.74, 11.94),
            L.latLng(57.6792, 11.949)
        ]
    }).addTo(map);

the OSRM service url is https://router.project-osrm.org/route/v1/driving/11.94,57.74;11.949,57.6792?overview=false&alternatives=true&steps=true&hints=;

How else can i achieve this?


Solution

  • The demo server documentation states:

    The demoserver will have a service-wide rate limit of 5000 req/minute. Looking at past logs, it stays below this about 98% of the time, but be prepared for HTTP 429 responses, and be aware that heavy usage may cause rate limiting for everyone else if you flood the server.