1

Hi I am setting up a server with multiple docker containers that are all running an application (Iperf3) that can only host one client at a time for a bandwidth test.

Using Nginx I would like to provide a dedicated link for a few seconds until a test is performed in point to point manner.

Right now my code (as shown below) is very simple, I am listening for tcp and udp on port 5201 and proxying the connections to 2 servers.

My first approach was to limit the number of connections per server to 1 so that only one client can connect at a time. However, each tests generates multiple connections so limiting the connections per server using the max_conns server parameter did not help me.

Since each test generates multiple connections and they need to be sent to the same server for the test to be successful I included hash $remote_addr consistent; so that there is client to server affinity.

The problem with my setup below is that Nginx will send multiple clients to the same servers and the request will be dropped by the server if it already performing a test with another client.

stream{
    upstream iperf_backends {
        hash $remote_addr consistent;
        server 127.0.0.1:5202;
        server 127.0.0.1:5203;
    }

    server{                                                                      
        listen 5201;
        listen 5201 udp;
        proxy_pass iperf_backends;
    }
}
David Lia
  • 11
  • 1

0 Answers0