Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
dedicating threads for request handling vs. computation in fastapi

I have a fastapi application that is very heavy on multi-threaded computation. That is, some requests, when processed, creating a lot of new threads for the process to complete. These requests return an "ok" fast, but then continue to process in the background.

In addition, I get lots of requests for status checking (e.g. is the previous process has finished, and "get me the results of the previous process"). some of the "get results" requests create new connections to an external database.

This seem to create an overload of requests, and many of them get timed-out.

I want to be able somehow to "split" my thread pool, so that there always be a"bandwidth" for status check and get results (with its db calling), while there be enough "threads" for the processing to continue in the background without anything getting stuck.

I looked at request rate limiting, but it doesn't seem to address all the issues (it just refuses some requests instead of timing them out). I also looked at --limit-concurrency option of uvicorn, but am not sure what would be its effect on the number of workers/threads that my application uses behind the scene.

Any insight/reference would be welcome

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!