Score:1

Nginx UDP proxy shared connection is busy

pr flag

We are proxying UDP packets for a game server through a Nginx reverse proxy. Clients timeout very often because the Nginx can't handle the requests. Initially it works flawlessly, but when more clients are connected to the game server (40-50), we encounter problems.

How could we make Nginx handle it?

Here is the proxy setup

stream {
    upstream backend {
        server [server-ip]:[port];
    }

    server {
        listen [port];
        proxy_pass backend;
    }

    server {
        listen [port] udp reuseport;
        proxy_pass backend;
    }
}

Our error log is full of errors like this:

2023/02/18 12:40:29 [alert] 3951459#3951459: *5777636 shared connection is busy while proxying and sending to client, udp client: [client-ip], server: 0.0.0.0:[port], upstream: "[server-ip]:[port]", bytes from/to client:1684904/1724744, bytes from/to upstream:1725538/1684904

How can I configure Nginx to handle these UDP packets?

Score:0
si flag

Try this:

stream { upstream backend { server [server-ip]:[port]; }

server {
    listen [port];
    proxy_pass backend;
}

server {
    listen [port] udp reuseport;
    proxy_pass backend;
    proxy_bind $remote_addr transparent;
}

}

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.