<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">There are a few approaches to this but they depend upon what you’re trying to achieve. Are your requests POSTs or GETs? Why do you have the mirroring configured?<div><br></div><div> If the root cause is that your mirror site cannot support the same workload as your primary site, what do you want to happen when your mirror site is overloaded? </div><div><br></div><div>One approach, using nginx, is to use rate limiting and connection limiting on your mirror server. This is described on the nginx website as part of the ddos mitigation section. </div><div>Or, if your bursts of activity are typically for the same resource then you can use caching with the proxy_cache_use_stale directive.</div><div><br></div><div>Another approach could be to use lua / openresty to implement a work- shedding interceptor (within nginx) that sits in front of your slow web server. Within lua you would need code that guesses whether or not your web server is overloaded and, if it is, it simply returns a 503 and doesn’t forward the request.</div><div><br></div><div><br></div><div><br></div><div><div><div id="AppleMailSignature">Sent from my iPhone</div><div><br>On Oct 27, 2017, at 2:24 AM, 安格 <<a href="mailto:yuanm12@163.com">yuanm12@163.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Dear Roman,</div><div><br></div><div>Thanks for your valuable response.<br>So ,is that means, If we optimize the parameter of the keep-alive to avoid keep-alive connection ? then we can avoid this kind of performance issue ?<br>Or if the mirror subrequest is slow than original subrequest, then we can't avoid this kind of performance issue ? Thanks in advance.</div><div><br></div><div style="position: relative; -ms-zoom: 1;">--<br><div><br></div><div>Regards,</div><div>Yuan Man</div><div><span style="font-family: Courier;">Trouble is a Friend.</span></div><div style="clear: both;"></div></div><div id="divNeteaseMailCard"></div><div><br></div><pre><br>At 2017-10-26 20:22:13, "Roman Arutyunyan" <<a href="mailto:arut@nginx.com">arut@nginx.com</a>> wrote:
>Hi,
>
>On Thu, Oct 26, 2017 at 03:15:02PM +0800, 安格 wrote:
>> Dear All,
>>
>>
>> I have faced a issue with Nginx "ngx_http_mirror_module" mirror function. want to discuss with you about this.
>>
>>
>> The situation is like below:
>> While I try to copy the request form original to mirror side, if the original application can process 600 request per seconds, but the mirror environment can only process 100 requests per seconds. Normally, even the mirror environment can't process all the request in time. it's should not impact the nginx forward the request to the original environment. But we observed if the mirror environment can't process all the request, then the Nginx will fall in issue , and original environment can't feedback process result to client in time. Then from client side, it seems the Nginx is down. If you have faced same issue before ? any suggestion ?
>
>A mirror request is executed in parallel with the main request and does not
>directly affect the main request execution time. However, if you send another
>request on the same client connection, it will not be processed until the
>previous request and all its subrequest (including mirror subrequests) finish.
>So if you use keep-alive client connections and your mirror subrequests are
>slow, you may experience some performance issues.
>
>--
>Roman Arutyunyan
>_______________________________________________
>nginx mailing list
><a href="mailto:nginx@nginx.org">nginx@nginx.org</a>
><a href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a>
</pre></div><br><br><span title="neteasefooter"><div id="netease_mail_footer"><div style="border-top:#CCC 1px solid;padding:10px 5px;font-size:17px;color:#777;line-height:22px"><a href="http://you.163.com/item/detail?id=1183001&from=web_gg_mail_jiaobiao_7" target="_blank" style="color:#3366FF;text-decoration:none">【网易自营】好吃到爆!鲜香弹滑加热即食,经典13香/麻辣小龙虾仅75元3斤>> </a>
</div></div></span></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>nginx mailing list</span><br><span><a href="mailto:nginx@nginx.org">nginx@nginx.org</a></span><br><span><a href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a></span></div></blockquote></div></div></body></html>