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

425
Visualizações
when i set worker time out in gunicorn for Django Application, other users are not able to access the application

I have a django application running on Gunicorn and Nginx. There is one request in application which takes 10 min to load the page [There is lot of data to process], i have increased the worker time to 1200 sec for Gunicorn to make it take sufficient time to load the page. it works fine but until that request is getting processed other users are not able to access the application gives :

504 Gateway Time-out nginx/1.21.4

This is my DOCKER

version: '3.8'

services:
  web:
    volumes:
      - static:/static
    command: python manage.py makemigrations /
    && python manage.py migrate && python manage.py collectstatic --noinput/
     && python manage.py crontab add /
     && exec gunicorn DrDNAC.wsgi:application --bind 0.0.0.0:8000 --timeout 1200"
    build:
      context: .
    ports:
      - "8000:8000"
    depends_on:
      - db
  db:
    image: postgres:13.0-alpine
  nginx:
    build: ./nginx
    volumes:
      - static:/static
    ports:
      - "80:80"
    depends_on:
      - web

volumes:
  postgres_data:
  static:

This is nginx:

upstream app {
    server web:8000;
}

server {
    listen 80;

    location / {
        proxy_pass https://app;
        proxy_connect_timeout 75s;
        proxy_read_timeout 300s;
    }
    location /static/ {
        alias /static/;
    }

}
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

This might happen because the amount of workers is not sufficient.

Try to increase the amount by adding --workers=4 to the gunicorn call.

gunicorn DrDNAC.wsgi:application --workers=4 --bind 0.0.0.0:8000 --timeout 1200

You can find more informations under the following link: https://docs.gunicorn.org/en/stable/settings.html#worker-processes

In addition you can also increase the amount of threads by using --threads 4

over 4 years ago · Santiago Trujillo Relatório
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