Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

142
Visualizações
Multiple workers not handling concurrent requests

I'm using FastApi hosted in a EC2 AWS instance.

EC2 Instance specs(g4dn.xlarge): 16 GB memory, 4 CPU, GPU: NVIDIA T4

I'm running a stress test to the app. If I send 10 simultaneous POST requests to the app, only 5 gets processed simultaneously (at the exact same time) whereas the others get processed one by one in different times (after few seconds).

The configuration is the following

gunicorn main:app --workers 9 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:80

I've set the workers to 9 given this formula The suggested maximum concurrent requests when using workers and threads is (2*CPU)+1.

Given the above configuration I'm expecting to get all the 10 requests handled at the exact same time.

With 9 workers I'm also getting CUDA out of memory error, even though I clean the cache.

With 3 workers I don't run into the CUDA problem, but the requests handled at the exact same time are only 3, no more than that. The remaining ones get processed later, after few seconds, one by one.

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda