You are viewing Nextmv legacy docs. ⚡️ Go to latest docs ⚡️

Cloud

Runtime Configuration

You will learn the basics of setting the runtime on cloud.

Runtime defines how long a Nextmv app will look for solutions. For example, the Dispatch app on Nextmv Cloud has a default runtime of 3 seconds. This means the app will spend up to 3 seconds looking for the best solution (or route, in this case) to a routing problem.

Runtime is configurable within Nextmv Cloud in a few ways:

  • In the demo UI runtime maxes out at 30 seconds. You can configure it via the

    slider.

  • With the API, runtime maxes out at 10 minutes. You can configure it at the

    beginning or end of your input using the JSON shown below.

{
  "options": {
      "solver": {
          "limits": {
              "duration": "500s"
          }
      }
  },
  "defaults": {
    "vehicles": {
      "shift_start": "2021-08-24T09:00:00-06:00",
      "speed": 10
    }
  },
  "vehicles": [
    { "id": "vehicle-1" },
    { "id": "vehicle-2" }
  ],
  "stops": [
    { "id": "location-1", "position": { "lon": 7.6129, "lat": 51.957 } },
    { "id": "location-2", "position": { "lon": 7.6166, "lat": 51.9635 } },
    { "id": "location-3", "position": { "lon": 7.6258, "lat": 51.9624 } },
    { "id": "location-4", "position": { "lon": 7.6386, "lat": 51.9449 } },
    { "id": "location-5", "position": { "lon": 7.5896, "lat": 51.9486 } }
  ]
}
Copy

If you are running a self-hosted version of Nextmv, runtime is configured with runners through environmental variables or command-line flags. Runtime is unlimited, but must be set, otherwise the app will run indefinitely. Runtime in this setting can also be impacted by a chosen runner. For example, when using the Lambda runner, runtime will timeout after 15 minutes.

Runtime considerations

Nextmv helps you make the best decision in the time you have. These are several factors to evaluate when setting your app runtime. A primary consideration is how long do your operations allow for you to make a decision. Do you have minutes, seconds, sub-seconds?

As your Nextmv app runs, it explores all available feasible and infeasible solutions (or states). In the process, Nextmv may find more feasible solutions, but will only return those that improve upon the last best solution. These are called improving solutions. Increasing runtime can provide more opportunities for Nextmv to find improving solutions. However, there is often a point of diminishing returns after which every additional second of runtime results in smaller (or no) increases in the number of improving solutions. The Nextmv Cloud demo UI includes out-of-the-box visualizations for helping you determine this point for your routing problem and operational constraints.

Page last updated

Go to on-page nav menu