Skip to content

Make high-latency partial endpoints async in FastAPI #12254

Description

@RayBB

Feature Request

Summary

One of the main benefits of moving to FastAPI is being able to handle I/O-bound work asynchronously so slow requests do not block workers and degrade performance for unrelated traffic.

We currently have several partial endpoints with relatively high response times. Endpoints that spend time waiting on outbound HTTP requests should be good candidates to convert to async. Endpoints that are tightly coupled to synchronous database access may be harder to improve and may need separate investigation.

Current timings:

Image

Problem

These endpoints may be tying up workers while waiting on network-bound operations. In a FastAPI app, this reduces the benefit of the migration and can slow down other requests under load.

Goal

Convert the partial endpoints below to async where feasible, prioritizing endpoints that perform outbound HTTP calls.

Scope

Endpoints to evaluate and convert:

Notes

  • Endpoints that make outbound HTTP requests should be straightforward candidates for async conversion.
  • Endpoints that directly depend on synchronous database access may not benefit immediately, or may require additional refactoring.
  • This work can be done in one PR or split into multiple PRs, depending on complexity and risk.
  • Please see make CarouselLoadMore partial fully async #12252 as an example for the pattern we want to follow.

I will be working on this as it is somewhat time sensitive for performance.

Breakdown

Implementation Details (for maintainers)

Related files

Refer to this map of common Endpoints:
*

Requirements Checklist

Checklist of requirements that need to be satisfied in order for this issue to be closed:

  • [ ]

Stakeholders


Instructions for Contributors

Metadata

Metadata

Assignees

Labels

Lead: @RayBBIssues overseen by Ray (Onboarding & Documentation Lead) [manages]Module: FastAPIPriority: 2Important, as time permits. [managed]Theme: PerformanceIssues related to UI or Server performance. [managed]Type: Feature RequestIssue describes a feature or enhancement we'd like to implement. [managed]

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions