For Workers & Pages, what is the name of the domain?
What is the issue or error you’re encountering
Huge latency spikes to d1, up to 94 seconds. DB id: 3d4f24ec-fa8d-4920-82b2-179fad18b18c
See dashboard metrics: https://dash.cloudflare.com/a3f6e70849e6eb5ca1ebaf6083bc84ba/workers/services/view/trafficlight/production/metrics
What steps have you taken to resolve the issue?
None, it mitigated by itself. I’m looking for a root cause to build trust that this won’t happen again. No response on discord:
This is not a large db, 65 kB. Now got an error log:
PrismaClientUnknownRequestError:
Invalid prisma.goal.findMany() invocation:
Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(SqliteError { extended_code: 1, message: Some("D1_ERROR: Network connection lost.") }), transient: false })
Code:
const findActivityStartTime = performance.now();
const activity = await prisma.activity.findFirst({
where: {
id: activityId,
goalId: goalId,
goal: {
userId: user.id,
},
},
});
const findActivityEndTime = performance.now();
console.log(
`Time to find activity: ${findActivityEndTime - findActivityStartTime}ms`
);