Aeron:Common Errors

Aeron 遇到的大多数问题通常都是由于资源问题造成的,如 CPU 资源不足、磁盘 I/O 速度慢、内存分页等。Linux 提供了许多工具来帮助诊断这些问题,其中一些工具将在 Aeron Troubleshooting 部分进行介绍。

一、Aeron timeouts

Media Driver Timeout

Media Driver Timeout 设置Media Driver的超时,并管理设置超时和客户端导体到media driver 超时的时间段。该值通过Media Driver上下文中的 driverTimeoutMsValue 或系统属性 aeron.driver.timeout 设置。该值以毫秒为单位。

DriverTimeoutException variants:

Error MessageDescription
MediaDriver keep-alive age exceeded (ms): timeout=x, actual=y当超过上次预期 keep-alive 消息发出后的最长时间段时,就会触发该超时。最常见的情况是系统资源过于紧张,和/或超时设置值过小。Media Driver 崩溃时也会发生这种情况。actual= 提供了自上一次驱动程序保持激活以来的经过时间。
no driver heartbeat detected当Client Conductor的启动时间加上Media Driver超时超过当前时间时,就会出现这种情况。通常情况下,这是由于Media Driver崩溃或超时值设置得过小所致。
no response from MediaDriver within (ns): x这种情况通常发生在media driver 超时或 Aeron 使用不正确的目录时
CnC file is created but not initialized.这种情况可能发生在 Cnc 文件已创建但尚未写入的情况下;通常需要给media driver 多一点时间/检查它是否已崩溃。

如果您的系统正在运行防病毒服务,建议您将Aeron写入日志缓冲区的目录排除在扫描范围之外。否则,Aeron 的性能将受到影响,有时甚至会受到严重影响。

Client Liveness Timeout

这将服务调用之间的超时设置为客户端的工作周期。通过 aeron.client.liveness.timeout 或Media Driver Context中的 clientLivenessTimeoutNs 设置。必须设置为小于或等于保持存活时间戳 (keepAliveIntervalNs) 的值。该值以纳秒为单位指定。默认为 10 秒。

ConductorServiceTimeoutException variants:

Error MessageDescription
service interval exceeded (ns): timeout=x, actual = y当一个client conductor工作周期到下一个client conductor工作周期之间的时间超过 clientLivenessTimeoutNs 设置的值时,就会触发该异常。此异常代表严重问题,会导致conductor终止。actual= 中给出的值是导致异常的最后一个工作周期的持续时间。

Client Conductor Timeout

Client Conductor Timeouts意味着Client Conductor and Driver Conductor之间的链接超时。这种情况往往发生在进程可用资源有限,client and/or driver conductors无法在规定时间内处理其工作周期的情况下。出现这种情况时,基本上有两种选择:增加超时或确保进程有足够的资源。

二、Other common errors 

检测Active Driver(Active Driver Detected)

ActiveDriverException 会在 Aeron 应用程序上次退出后不久重新启动时发生。Media Driver每秒都会在 cnc.dat 文件中记录活动时间戳,并在启动时检查时间戳是否少于 10 秒。如果少于 10 秒,Media Driver将拒绝启动。这样做是为了防止多个Media Driver使用同一目录,以免造成问题。要防止出现错误,要么等待 10 秒后重试,要么通过上下文将Media Driver目录设置为启动时删除:

MediaDriver.Context ctx = new MediaDriver.Context().dirDeleteOnStart(true);

or via JVM argument:

-Daeron.dir.delete.on.start=true

请注意,10 秒超时是默认值。如果运行时配置了扩展驱动程序超时(extended driver timeout ),或连接了调试器(debugger)并设置了 aeron.debug.timeout,则超时时间会更长。

Unable to allocate counter; buffer is full

当计数器缓冲区已满时,将引发 IllegalStateException 异常。Aeron的计数器缓冲区可容纳8,192个条目,而有些东西已经把它们都用完了—这很可能是资源泄漏,比如一个尚未关闭的Subscription

您可以通过 AeronStat 或通过 Aeron 客户端上的CountersReader对象countersReader()查看计数器。这对识别资源泄漏特别有用。

Message exceeds maxMessageLength 

提供给publication的消息超过了最大长度。See How to send messages over 8kb

Cannot assign requested address

这种情况往往发生在订阅(Subscription)中使用了错误的地址。Publications向订阅(Subscription)发送数据,因此Publications需要订阅(Subscription)的地址,而订阅(Subscription)需要自己的地址,而不是publication。(This tends to happen when using the wrong address in a subscription. Publications send data to subscriptions, so publications need the address of the subscription, and subscriptions need their own address, not the publication.)

Example:

  • Publication正在主机 10.10.1.1 上运行,向数据流 100 发送信息(Publication is running on host 10.10.1.1 sending to stream 100)
  • Subscription在主机 10.10.1.2 上运行,端口 1234,监听数据流 100(Subscription is running on host 10.10.1.2 port 1234 listening on stream 100)
  • 在这种情况下,Publication和Subscription都应使用 10.10.1.2 端口 1234,数据流 100。(In this case, both the publication and subscription should make use of 10.10.1.2 port 1234, stream 100.)

See also the Aeron wiki on Channel Configuration

 

  • 12
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值