0

I need to duplicate/mirror the traffic comming to my server.

I mean, I have N backend servers A1 A2 ... An(n>=2) and a nginx as reverse-proxy&load-balancer.

All the traffic comming to Nginx redirect to both Ax and Ay(x!=y) in parallel, if one of the server is down(timeout or 5xx), then the other server's response can be used immediately and return the result to the client.

By mirroring the traffic(not retry but send the duplicated requests in parallel), I can create redundancy, it means more than one backend servers can process one request at the same time.

I need to response to the client within 30ms, if set retries=1, the timeout must set to 15ms(hard to archive), so mirror the traffic can be a solution.

Is it possible?

Scott混合理论
  • 1,101
  • 1
  • 7
  • 5

1 Answers1

0

Your question almost has an answer itself in general. That are you describing are just load balancing with health checks. That is definitely possible with nginx and such setup are described on their docs: http://nginx.org/en/docs/http/load_balancing.html

NStorm
  • 1,248
  • 7
  • 18
  • actually i want to create some redundancies, the java backend frequently young GC(10ms-200ms), but my client requires my application responses within 30ms. so duplicate the traffic is the best solution. – Scott混合理论 Jul 31 '21 at 00:30