Score:0

Mirroring Traffic with Nginx(to increase avaliablity and decrease latency )

in flag

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?

Score:0
np flag

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

in flag
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.
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.