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

423
Views
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 answers
Answer question

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 Report
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!