在应用程序启动时出现连接超时问题。

huangapple go评论94阅读模式
英文:

Getting connection timeouts on application startup

问题

We have a staging instance of our web app that connects to DataStax Astra PAYG using NodeJS driver.

有一个连接到 DataStax Astra PAYG 的 NodeJS 驱动程序的我们的 Web 应用的暂存实例。

Sometimes when the app has been idle and is first accessed we get repeated instances of this error for around a minute, then the errors stop and normal function resumes. We have set consistency to cassandra.types.consistencies.localQuorum

有时,当应用程序处于空闲状态并首次访问时,我们会在大约一分钟内重复出现这个错误,然后错误停止,正常功能恢复。我们已将一致性设置为cassandra.types.consistencies.localQuorum

Server timeout during read query at consistency LOCAL_QUORUM (1 replica(s) responded over 2 required)

在一致性 LOCAL_QUORUM 下读取查询时出现服务器超时(1 个副本已响应,需要 2 个)。

I'd just like to understand if our Astra database may require time to warm up if it has been idle.

我只是想了解一下,如果我们的 Astra 数据库处于空闲状态,是否需要时间来预热。

We occasionally during what I'll call warm up, we may also experience connection timeout issues:

在我称之为“预热”期间,我们偶尔也可能遇到连接超时问题:

"{ labels: [ 'ERROR' ],
message: '""[SERVER][FATAL] Restarting due to: [x.x.x.x:9042] Request execution failed, took 7000 ms (request size 52 bytes): SELECT * FROM x WHERE name = ? [x@x.x]; error: OperationTimedOutError: The host 40.82.203.91:29042 did not reply before timeout 7000 ms

“{标签:[ 'ERROR' ],
消息:'""[SERVER][FATAL] 由于:[x.x.x.x:9042] 请求执行失败,耗时 7000 毫秒(请求大小 52 字节):SELECT * FROM x WHERE name = ? [x@x.x];错误:OperationTimedOutError:主机 40.82.203.91:29042 在超时 7000 毫秒之前未响应

For clarity, under normal operation we not see these errors.

为了明确起见,在正常操作下,我们不会看到这些错误。

Can anyone comment?

有人可以发表评论吗?

Rod

英文:

We have a staging instance of our web app that connects to DataStax Astra PAYG using NodeJS driver.

Sometimes when the app has been idle and is first accessed we get repeated instances of this error for around a minute, then the errors stop and normal function resumes. We have set consistency to cassandra.types.consistencies.localQuorum

Server timeout during read query at consistency LOCAL_QUORUM (1 replica(s) responded over 2 required)

I'd just like to understand if our Astra database may require time to warm up if it has been idle.

We occasionally during what I'll call warm up, we may also experience connection timeout issues:

"{\n  labels: [ 'ERROR' ],\n  message: '\"[SERVER][FATAL] Restarting due to: [x.x.x.x:9042] Request execution failed, took 7000 ms (request size 52 bytes): SELECT * FROM x WHERE name = ? [x@x.x]; error: OperationTimedOutError: The host 40.82.203.91:29042 did not reply before timeout 7000 ms

For clarity, under normal operation we not see these errors.

Can anyone comment?

Rod

答案1

得分: 1

你描述的症状表明你正在使用一个“免费”账户。

如果是这样的话,当你的 Astra DB 在一段时间内处于空闲状态时,它会进入休眠状态(或“停放”)。当你的应用程序在启动时连接到集群时,该操作会将数据库从休眠状态唤醒。这就是为什么在应用程序正常运行时你看不到错误的原因。

如果你正在进行概念验证(PoC),我建议使用 Astra web UI 底部右侧的实时聊天功能 联系 DataStax 团队。他们将很乐意讨论你的用例,并提供免费的积分,以防止你的 Astra DB 进入休眠状态。祝好运!

英文:

The symptoms you described indicate to me that you are using a "free" account.

If that's the case, your Astra DB gets hibernated (or "parked") when it's been idle for some time. When your application connects to the cluster on startup, that operation "wakes" the DB from hibernation. This is the reason you don't see the errors when the application has been operating as normal.

If you're doing a proof-of-concept (PoC), I would recommend getting in contact with the team at DataStax using the live chat functionality on the bottom right of the Astra web UI. They will be happy to talk about your use case and provide free credits so your Astra DB does not get hibernated. Cheers!

huangapple
  • 本文由 发表于 2023年5月15日 12:20:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/76250867.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定