← 返回起始笔记位置

知识卡片

普通读书笔记卡 · 2545.b.1.a

缩容先排空再销毁

理解等级:高级

移除实例先通知均衡器停止派新请求,再让服务完成或妥善结束在途活动,最后关闭回收,这称为draining。服务需提供相应退出接口并处理未完成工作。直接销毁虽然释放资源快,却可能丢响应和状态,引发客户端重试与重复副作用。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 云与分布式计算 · 查看原书依据

      When the autoscaler removes an instance, it cannot just shut down the VM. First, it must notify the load balancer to stop sending requests to the service instance. Next, because the instance may be in the process of servicing a request, the autoscaler must notify the instance that it should terminate its activities and shut down, after which it can be destroyed. This process is called “draining” the instance. As a service developer, you are responsible for implementing the appropriate interface to receive instructions to terminate and drain an instance of your service.

    参考来源

    - 位置:《Software Architecture in Practice, 4th Edition》第17章《云与分布式计算》(来源项目:book-sources;源文件:extracted/Software Architecture in Practice, 4th Edition/_epub-src/ch17.html) - 结论依据:所引连续原文给出本卡机制或取舍;条件与示例结合本节已读上下文解释。 - 原始内容:When the autoscaler removes an instance, it cannot just shut down the VM. First, it must notify the load balancer to stop sending requests to the service instance. Next, because the instance may be in the process of servicing a request, the autoscaler must notify the instance that it should terminate its activities and shut down, after which it can be destroyed. This process is called “draining” the instance. As a service developer, you are responsible for implementing the appropriate interface to receive instructions to terminate and drain an instance of your service.