1

I have configured nginx, uWSGI server for my Django application. Everything seems fine, bet when I do some requests using wrk, nginx server instantly starts to respond 502 Bad Gateway (I think uWSGI crashes). When I stop wrk, everything starts to work properly. Is there some limit, how many requests can be made on certain amount of time or something else? This is a very bad issue, since the system will crash if lots of users will use it.

My uWSGI configuration:

[uwsgi]

base         = /home/user/
project      = app
home         = %(base)/env
module       = %(project).wsgi:application

master       = true
processes    = 5

socket       = /var/sockets/app.sock
chmod-socket = 664
uid          = www-data
gid          = www-data

harakiri     = 600
vacuum       = true

die-on-term  = true

My nginx configuration:

server {
    listen      8000;
    server_name 127.0.0.1;
    charset     utf-8;

    location /media  {
        alias /home/user/app/media;
    }

    location /static {
        alias /home/user/app/static;
    }

    location / {
        uwsgi_pass         unix:/var/sockets/app.sock;
        uwsgi_read_timeout 600;
        include            /home/user/app/uwsgi_params;
    }
}
Ben
  • 99
  • 2
  • 6

1 Answers1

0

Someone with a similar problem was given the solution:

This should fix it...

You have: fastcgi_buffers 4 256k;

Change it to: fastcgi_buffers 256 16k; // 4096k total

Also set fastcgi_max_temp_file_size 0, that will disable buffering to disk if replies start to exceeed your fastcgi buffers.

Have you tried that?

Community
  • 1
  • 1
serv-inc
  • 35,772
  • 9
  • 166
  • 188