Request parameters exceed the server configuration limits


I’m trying to compute a pairwise distance matrix. Apparently I’ve exceeded the total of routes are allowed by configuration. My API call consists of 597 locations, which means 356409 routes computation. I’ve made the corresponding changes in the config file (or so I think).

Config (app.config):

     "info": {
       "base_url": "",
       "support_mail": "",
       "author_tag": "openrouteservice",
       "content_licence": "LGPL 3.0"
            "attribution":", OpenStreetMap contributors"
                  "profiles":"driving-car, driving-hgv, cycling-regular, foot-walking",
                  "profiles":"driving-car, driving-hgv, cycling-regular, foot-walking",
            "attribution":", OpenStreetMap contributors"
            "attribution":", OpenStreetMap contributors",
               "default_params": {
                   "encoder_flags_size": 8,
                   "graphs_root_path": "data/graphs",
                   "elevation_provider": "multi",
                       "elevation_cache_path": "data/elevation_cache",
                   "elevation_clear_cache": true,
                   "instructions": true,
                   "maximum_distance": 100000,
                   "maximum_segment_distance_with_dynamic_weights": 100000,
                   "maximum_waypoints": 50

Erro message:

openrouteservice.exceptions.ApiError: 400 ({'info': {'timestamp': 1559749512432, 'engine': {'build_date': '2019-06-01T20:46:11Z', 'version': '5.0.1'}}, 'error': {'code': 6004, 'message': 'Request parameters exceed the server configuration limits. Only a total of 356409 routes are allowed.'}})

What could I be doind wrong?
Thank you in advance.

@ryuzakyl what is the maximum of locations that still works?

Can you try the latest master branch @ryuzakyl? I introduced a fix for matrix wrt to limits last week:

Note though, that you’ll have to adapt your app.config. Oh wait, that might the problem… Did you pull the latest master recently and didn’t change your app.config? See the note at the bottom of the PR comment linked above, that should fix it.

1 Like

Hi @timothy.

The the maximum amount of locations currently working is 50. For any number of locations greater than 50, I get the following error message:

openrouteservice.exceptions.ApiError: 400 ({'info': {'engine': {'build_date': '2019-06-01T20:46:11Z', 'version': '5.0.1'}, 'timestamp': 1559765930590}, 'error': {'code': 6004, 'message': 'Request parameters exceed the server configuration limits. Only a total of 3025 routes are allowed.'}})

Perhaps I should update some configurations in the app.config file. Any advice?
Thanks in advance.

That’s why I’m referring to. Please follow my advice and let us know if it worked.

Hi @nils.

It works!!! Thank you very much :wink:.

I apologize for failing to carefully read your previous response.

Thanks once again.
Best regards.

Very nice, glad to hear that :slight_smile:

Im a complete n00b to the area, so please be patient! Im getting the same message as ryuzakyl, and my search led me to this post. I have about 150 locations (lat long encoded).

Where (on the website) can I find out what the limitations are? And if they can be overcome?

Thanks in advance for your response

@ryuzakyl was asking wrt to local installation. See here for instructions:

For our API you can see limits here:

1 Like

Ok, thank you for replying. I am using the API.

Ok, lets see if I understand correctly. If I use the API, with app.config on openrouteservice server, there is a limit on maximum number of routes that can be calculated (50x50=2500). If I try to install locally on my machine I can set in app.config to something higher, like 150x150=22,500?

Yes, that’s correct :slight_smile:. There should be plenty of info for troubleshooting in this forum.

Good luck!

First, thank you for all the help youve given. I know Im completely new. I followed the instructions and installed on a server. Endpoints such as http://:8080/ors/status or http://:8080/ors/health appear to work from the browser, but when I call via the API (google apps script) it just doesnt work.

Do I need to install another ORS project to get this working?


but when I call via the API (google apps script) it just doesnt work.

Well, hard to troubleshoot with that description;)

What exactly is not working? I have no idea about google apps scripts, but shouldn’t matter, as long as it knows how to do HTTP(S) requests with POST and parse JSON’s.

Google Apps Script is based on Javascript. I have some sample code below, which calls ORS optimization:

  console.log("Hello. Start OptimizeRoute script....");
  //Get StartStop coordinates
  var url = '';
  var locnFiles = DriveApp.searchFiles('fullText contains "Locn_Data" ');
  while (locnFiles.hasNext()) {
    var locnFile =;
    var locnListStr = locnFile.getBlob().getDataAsString();
    var locnListObj = JSON.parse(locnListStr);
    var options = {
          'headers' : {'ApplicationAccessKey' : '<MyApplication Access Key>',
                       'Accept' : 'application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8',
                       'Authorization': '<Authorization>' },
          'muteHttpExceptions': true,
          'method' : 'POST',
          'contentType': 'application/json',
          'payload' : locnListStr
      var response = UrlFetchApp.fetch(url, options); 
      var data = JSON.parse(response.getContentText());
      var respText = response.getContentText();

This code works with url = ‘ , UrlFetchApp returns from being called, with some result. In the url, if I substitute “” with the name of my server where I installed ORS, the call to UrlFetchApp just fails, doesnt return, and does log anything in the google apps script log file. However, if I go to the test links for my server, they work. E.g

Do I have to create api access to my server so I can call it the same way I call from google apps script?

Ah ok, now I know what you mean. In this case, yes, you’ll have to install more software, as the optimization endpoint is not from our stack. It’s sorta explained in the API playground, but you might’ve missed it.

So, you need the optimizer itself:

And it’s HTTP wrapper:

Both are fairly easy to set up. I’d recommend a 4 core processor, in contrast to ORS Vroom benefits from more processing power than RAM. FYI, we run it on 16GB RAM & 4 cores and can serve up to 30-50 concurrent requests. It calls ORS Matrix endpoint (or OSRM) for the durations, which typically takes longer than solving the VRP.

Our production environment comes from here (the only minor edit compared to upstream was a small change in URL):

Im sorry, it looks like a little bit too much work than I planned for, plus my “server” is an Amazon EC2 freebie that certainly wont come anywhere close to the specs you mentioned. Im doing this for a charity Im a part of, we need to organise up to 300 locations (lat long) so that we can save time and petrol money (gas) when we visit locations.

Im going to try to see if there is another way to achieve our goal. Thanks again for your advice and help!

1 Like

Hi there,
First of all for all the info you have provided :slight_smile:
I’m having an issue with the app installed on my local host where I’m running into the matrix route limit (which I believe is requests of up to 100 route)
{'error': {'code': 6004, 'message': 'Request parameters exceed the server configuration limits. Only a total of 100 routes are allowed.'}, 'info': {'engine': {'version': '6.3.1', 'build_date': '2020-12-15T21:54:52Z'}, 'timestamp': 1608069827458}}

I mounted a modified app.config and did a docker compose down and the up with the modified file.
I changed the limit to 1 million (I need a limit capable of doing 1000x1000)
"matrix": { "enabled": true, "maximum_routes": 1000000, "maximum_routes_flexible": 1000, "maximum_search_radius": 5000, "maximum_visited_nodes": 100000, "allow_resolve_locations": true, "attribution": ", OpenStreetMap contributors" },
I checked inside the container that the app.config file was correctly mounted on the container after doing the docker compose up, but when trying to run my request I still get the same error I shared above indicating the matrix request limit :frowning:

How could I get this to accept the larger request? I understand the performance of larger requests wont be stellar, but from smaller experiments it runns way faster than doing directions api requests for the same amount of routes :slight_smile:
I don´t know if it is relevant, but I am running the app allowing for 5 cores (12 threads) and max 8gb of ram :slight_smile: I plan on getting a more powerful machine tough, cpu stocks with the pandemic has been horrible :’(

Edit, after killing the container a couple of times and doing docker-compose up now it works :slight_smile:

Seems like I was doing something wrong or some sort of cache was causing my changes not to take effect.