策略: Google在数据挖掘中使用Canary Request来试探测Query的破坏性

Google在上千个节点上查询内存中的数据并合并结果,其中最严重的问题之一就是:死亡查询(Query of Death)

一个查询可能导致一个程序失败,失败的原因可能是程序bug或者其它因素。这意味着一个单独的查询有可能导致整个集群崩溃。这对于可用性和响应时间来说都是不好的, 因为重新恢复成千台机器的运行时环境需要较长时间。因此,将这样的查询称为死亡查询 。 新的查询不断进入系统,新的软件也不断部署到系统上,导致死亡查询 问题不可能完全被解决。

两个可行方案:
* 针对日志的测试 :google重放了一个月的日志,看这些日志中有什么样的查询会导致系统挂起。这种方法有意义,但是死亡查询依然会出现。
* 发送Canary Request : 将一个请求发送到一台机器上。如果这个请求被成功执行,那么可以推想,这个请求能在所有机器上成功被执行,所以,可以放行这个请求到集群中。如果这个请求 失败,那么只会导致那一台机器挂起,无伤大雅。然后再选一台机器,重新测试请求来确认这个请求是否真的是死亡查询。如果一个请求失败过一定的次数,那么这 个请求将会被拒绝执行,并且记入日志中,将来用于进一步debug。

这样做的结果是,只有几台机器会挂起,而不是成千台机器同时失败。这个技术很聪明,它利用了已有的扩展技术(scale-out)和连续部署技术 (continuous deplyment)。这种策略应该也可以被其他系统所借鉴。

Strategy: Google Sends Canary Requests into the DataMine

Google runs queries against thousands of in-memory index nodes in parallel and then merges the results. One of the interesting problems with this approach, explains Google's Jeff Dean in this lecture at Stanford , is the Query of Death .

A query can cause a program to fail because of bugs or various other issues. This means that a single query can take down an entire cluster of machines, which is not good for availability and response times, as it takes quite a while for thousands of machines to recover. Thus the Query of Death. New queries are always coming into the system and when you are always rolling out new software, it's impossible to completely get rid of the problem.

Two solutions:

  • Test against logs . Google replays a month's worth of logs to see if any of those queries kill anything. That helps, but Queries of Death may still happen.
  • Send a canary request . A request is sent to one machine. If the request succeeds then it will probably succeedon all machines, so go ahead with the query. If the request fails the only one machine is down, no big deal. Now try the request again on another machine to verify that it really is a query of death. If the request fails a certain number of times then the request if rejected and logged for further debugging.

The result is only a few servers are crashed instead of 1000s. This is a pretty clever technique, especially given the combined trends of scale-out and continuous deployment. It could also be a useful strategy for others.

内容概要:本文全面解析了数智化毕业设计项目开发与写作技巧,涵盖关键概念、核心技巧、应用场景、代码案例分析及未来发展趋势。首先定义了数智化毕业设计项目,强调数据赋能性、智能交互性和场景适配性,并指出数智化写作技巧的重要性。接着介绍了项目开发的“需求锚定 - 技术匹配 - 迭代优化”三步法,以及写作的“问题导向 - 方案论证 - 成果验证”结构。文章列举了教育、医疗、工业等领域的应用场景,如智能学习推荐系统、疾病风险预测模型等。最后通过“基于用户行为数据的智能商品推荐系统”的代码案例,详细展示了数据预处理、协同过滤模型构建及模型评估过程。展望未来,数智化毕业设计将呈现轻量化开发、跨学科融合和落地性强化的趋势。 适合人群:高等院校即将进行毕业设计的学生,特别是对数智化技术感兴趣的理工科学生。 使用场景及目标:①帮助学生理解数智化毕业设计的关键概念和技术实现路径;②指导学生掌握项目开发和写作的具体技巧;③提供实际应用场景和代码案例,增强学生的实践能力;④引导学生关注数智化技术的未来发展趋势。 阅读建议:本文内容丰富,建议读者先通读全文,把握整体框架,再深入研读感兴趣的部分。对于代码案例部分,建议结合实际操作进行学习,加深理解。同时,关注文中提到的未来发展趋势,为自己的毕业设计选题提供参考。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值