I'm using the following configuration for my nginx server:
upstream django {
server unix:///var/www/example.com/django/ws/django.socket;
}
upstream io_nodes {
ip_hash;
server 127.0.0.1:8080;
}
limit_req_zone $binary_remote_addr zone=one:100m rate=1000r/s;
server {
listen 80;
server_name example.com;
root /var/www/example.com;
location /static {
alias /var/www/example.com/media;
}
location / {
limit_req zone=one burst=500 nodelay;
uwsgi_pass django;
include /etc/nginx/uwsgi_params;
}
location /socket.io/ {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_pass http://io_nodes;
}
}
When I send POST requests to /socket/message, only 5 requests will be handled immediately, the rest will be delayed. After a while, the next 5 requests will be handled and so on. So I assume it has something to do with the limit_req settings, but setting it to a really high value, didn't help. So what could be the problem?