Google在上千个节点上查询内存中的数据并合并结果,其中最严重的问题之一就是:死亡查询(Query of Death)
一个查询可能导致一个程序失败,失败的原因可能是程序bug或者其它因素。这意味着一个单独的查询有可能导致整个集群崩溃。这对于可用性和响应时间来说都是不好的,
因为重新恢复成千台机器的运行时环境需要较长时间。因此,将这样的查询称为死亡查询
。
新的查询不断进入系统,新的软件也不断部署到系统上,导致死亡查询
问题不可能完全被解决。
两个可行方案:
* 针对日志的测试
:google重放了一个月的日志,看这些日志中有什么样的查询会导致系统挂起。这种方法有意义,但是死亡查询依然会出现。
* 发送Canary Request
:
将一个请求发送到一台机器上。如果这个请求被成功执行,那么可以推想,这个请求能在所有机器上成功被执行,所以,可以放行这个请求到集群中。如果这个请求
失败,那么只会导致那一台机器挂起,无伤大雅。然后再选一台机器,重新测试请求来确认这个请求是否真的是死亡查询。如果一个请求失败过一定的次数,那么这
个请求将会被拒绝执行,并且记入日志中,将来用于进一步debug。
这样做的结果是,只有几台机器会挂起,而不是成千台机器同时失败。这个技术很聪明,它利用了已有的扩展技术(scale-out)和连续部署技术
(continuous deplyment)。这种策略应该也可以被其他系统所借鉴。
Monday,
November 22, 2010 at 8:27AM
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.
分享到:
相关推荐
Flagger使用服务网格(App Mesh,Istio,Linkerd)或入口控制器(Contour,Glo,NGINX,Skipper,Traefik)来实现多种部署策略(Canary版本,A / B测试,蓝色/绿色镜像)或用于流量路由的入口控制器。 对于发布分析...
我们知道,在32位系统上,对于栈溢出漏洞,攻击者通常是通过溢出栈缓冲区,覆盖栈上保存的函数返回地址来达到劫持程序执行流的目的。Stackcanary保护机制在刚进入函数时,在栈上放置一个标志canary,然后在函数结束...
//=> '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary' chromePaths . chromium ; //=> '/Applications/Chromium.app/Contents/MacOS/Chromium' // On Linux chromePaths . chrome ;...
esp-canary什么这是简单的基于ESP-8266或ESP-32的canary应用程序,它充当本地网络上的服务器,并会通知您是否正在访问或扫描它。 理想情况下,服务的Nmap扫描应返回与真实服务器相同的结果。 任何类型的扫描或连接...
HttpCanary证书模块.zip
Android Studio Chipmunk Canary 7(android-studio-2021.2.1.7-windows.zip) Android Studio 版本倒序排列: Android Studio Chipmunk 2021.2.1 花栗鼠 (新版命名) Android Studio Chipmunk Beta 1 available ...
chrome canary 开发者专用专用专用~
不和谐数据挖掘通过比较提供给Canary Client的javascript文件(每次构建更改具有不同的哈希值)来完成数据挖掘。 请记住,许多构建更改具有变量重命名,新选项卡,换行符等功能。这些功能通常不会在用户端更改任何...
这款软件不仅可以帮助用户快速查询手机上大幅度消耗网络设备资源的大流量数据文件,还能够对手机进行实时监控,防止有恶意软件篡改手机系统,使用非常安全。同时,该软件整体界面非常简洁,操作也是非常的方便快捷,...
Httpcanary破解版是一款主打安卓手机抓包功能的应用。可以帮你快捷的在手机上进行抓包应用,丰富的工具给你更好的体验,该版本已经全面解锁高级专业版功能,给你带来更好的体验。
HttpCanary高级版
大名鼎鼎的Google Chrome - Canary(金丝雀)版,更适合移动开发人士使用
HttpCanary.pem
无服务器插件Canary部署 一个无服务器插件,用于实现Lambda函数的金丝雀部署,结合使用和 内容 安装 npm i --save-dev serverless-plugin-canary-deployments 用法 要启用Lambda功能的逐步部署,您的serverless.yml...
二进制漏洞挖掘-栈溢出-开启Canary1
USB Canary是Linux和OSX工具,使用psutil来全天候或在计算机锁定时使用psutil监视USB设备。 可以将其配置为通过Twilio API向您发送短信,使用其内置的Slack bot通知Slack频道或通过Pushover发送推送消息。 免责...
安装HttpCanary之后,需要安装证书,有些手机需要在设置里自行安装,需要导入此文件进行安装。
sudo_canary (不稳定)sudo_canary是基于discord.js v12库的Discord机器人。 该bot仍在开发中,并且是sudo_!的测试版本。 出以获得稳定的版本!
Chrome Canary 64位 Windows 54.0.2802.2 canary 20160721最新