重试机制
来源:互联网 发布:数据共享的方式 编辑:程序博客网 时间:2024/05/17 06:11
http://docs.aws.amazon.com/general/latest/gr/api-retries.html
Error Retries and Exponential Backoff in AWS
Numerous components on a network, such as DNS servers, switches, load balancers, and others can generate errors anywhere in the life of a given request. The usual technique for dealing with these error responses in a networked environment is to implement retries in the client application. This technique increases the reliability of the application and reduces operational costs for the developer.
Each AWS SDK implements automatic retry logic. The AWS SDK for Java automatically retries requests, and you can configure the retry settings using the ClientConfiguration class. For example, you might want to turn off the retry logic for a web page that makes a request with minimal latency and no retries. Use the ClientConfiguration class and provide a maxErrorRetry value of 0 to turn off the retries.
If you're not using an AWS SDK, you should retry original requests that receive server (5xx) or throttling errors. However, client errors (4xx) indicate that you need to revise the request to correct the problem before trying again.
In addition to simple retries, each AWS SDK implements exponential backoff algorithm for better flow control. The idea behind exponential backoff is to use progressively longer waits between retries for consecutive error responses. You should implement a maximum delay interval, as well as a maximum number of retries. The maximum delay interval and maximum number of retries are not necessarily fixed values, and should be set based on the operation being performed, as well as other local factors, such as network latency.
Most exponential backoff algorithms use jitter (randomized delay) to prevent successive collisions. Because you aren't trying to avoid such collisions in these cases, you don't need to use this random number. However, if you use concurrent clients, jitter can help your requests succeed faster. For more information, see the blog post for Exponential Backoff and Jitter.
The following pseudo code shows one way to poll for a status using an incremental delay.
- 重试机制
- zmq req重试机制
- nginx的重试机制
- Retry重试机制
- ActiveMQ消费重试机制
- HBase-客户端重试机制
- java 重试机制总结
- dubbo的重试机制
- C#重试机制类
- Retry重试机制
- HBase之重试机制
- Retry重试机制
- ActiveMQ的消息重试机制
- Volley超时重试机制详解
- [Android6.0] 数据业务重试机制
- Volley超时重试机制详解
- Spring Cloud Ribbon 重试机制
- java调度器(重试机制)实现
- python练习(二)——失败的
- JavaScript 对象和数组
- 高中OJ3511. 【NOIP2013模拟11.5A组】cza的蛋糕(cake)
- HDU 6041 I Curse Myself(边双连通分量+优先队列)
- 排序合集
- 重试机制
- python-pandas的基本用法05
- Hibernate学习之---Hibernate的批量处理
- android 初看事件处理
- spark 报错:py4j.protocol.Py4JJavaError
- JSP中include静态文件HTML出乱码解决方案
- Java键盘输入方式总结
- HOMEJAVAJDK动态代理代理与Cglib代理原理探究
- 树莓派Python3使用RC522