Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the near future we should explore options to have the AOT calculation background tasks run in a separate process, so make full use of additional CPU cores and reduce it’s impact on the main API thread responsible for handling requests.

See for example using Celery:

Alternatively, since our traffic is fairly low, we can continue using FastAPI BackgroundTask for request-time tasks, and just create a separate container instance that only runs the scheduled tasks, and not the actual API listener. Effectively the codebase has two entry points, one starts the API, and the other just runs scheduled tasks.