#retry

Get back up and try again: retrying in Python

Published at April 17, 2019 ·  1 min read

在 error retry 设计中的一个技巧,对于后端微服务架构中,当一个被其他服务依赖度很高的服务崩溃时,其他服务相关的请求 failed 后该如何做呢?是不断的重试?如果一个很小的错误引发短暂的 failed,后续会引发其他相关依赖的服务短时间内的大量重试反而会加重该服务的负载压力。所以需要一个 exponential backoff 或者 randomized backoff 机制,将之后的重试以随机时间或指数关系后退,直到服务上线,避免雪崩效应 Get back up and try again: retrying in Python...


Get back up and try again: retrying in Python

Published at April 17, 2019 ·  1 min read

装饰器的一个很好的用法,将 retry 的时间 randomize 以实现避免用尝试将服务器带来放大的压力 Get back up and try again: retrying in Python...


Tags

abcs accept acid activemq affinity algorithm allocation android array async aws b+tree b-tree backoff benchmark best-practices bfs big-o bigquery bind bitcount blog break broker bubble buffer cache cap cert cgroups channel citus class classmethod cluster concurrency config consumer container cookie cors crawler cronjob csrf ctr data-science data-structure database datadog dataflow datascience decorator defer dfs distributed django dns docker double-shipping drf ecosia elastic-search enumerate epoll extra facebook-pixel financial-report flask flutter forward-proxy freelance frp garbage-collector gc gcp generator get gil git golang goroutine graphql ha handbook haproxy hash hash-slot hashring hashtable hpa http http-auth http-proxy http_proxy https index innodb instagram intergration interview ios javascript jinja2 jobboard jwt k8s kafka kibana kqueue label lambda layer4 layer7 lean levels.io linked-list linux list listen loadbalancer logs long-tail lru marketing master matplotlib memory merge metaclass metaprogramming metrics metrics-server microservices mitm model mq myisam mysql namespace nat netflix network-extension nginx nodejs nomad nosql npm oodesign openssl optimization orm pandas parallelism parkinglot patroni permission pg pipeline pixelme post postgresql postresql prefetch_related prerender process proxy proxycommand put pvm python queue rabbitmq rbac react-native rebase redis redis-cluster replication resource rest restfulapi retargeting retry revenue reverse-proxy rocketmq saas scaleable search-engine security select seo serverless service session set shadosocks shadowsocks shard sharding shell shopify sigint signal sigterm slack slave slow-query sniper sns socket socks5 source-code spa sql sqlalchemy sqs ssh ssl ssl-pinning stack startup state stateful stateless staticmethod string struct swift switch syscall system-design systemctl tcp tcp-proxy thread tmpreaper token traefik trustkit tunning type typeform udp variable vc vpn vuejs web web-development where yarn zset 削峰 宽索引 异步 窄索引 解耦 跨域 跳板机


Archives

2019 (137)
0001 (1)