Getting connection timeouts on application startup

208 Views Asked by At

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 = ? [[email protected]]; 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

There are 1 best solutions below

6
On

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!