A question about Kratos horizontal scaling. We re...
# talk-kratos
d
A question about Kratos horizontal scaling. We recently upgraded from v0.11.1 to v1.0.0. When we did we found that if we were running more than one horizontally scaled Kratos instance (k8s), we got DB connection (postgres) errors
msg=No valid session found. audience=audit error=map[message:unable to fetch records: FATAL: query_wait_timeout (SQLSTATE 08P01) stack_trace:
We investigated and it seems that database connections were being used up and seemingly not re-used. We managed to work around this by setting
max_idle_conns=0
in the DSN which fixed the behaviour. My question is, has anyone seen this behaviour before and is there an explanation anywhere for this behaviour? The default value which mirrors the CPU cores seems to be dangerous in that it stops our kratos setup in it’s tracks!
Does anyone have any thoughts on this?
f
we have the same. Thanks for sharing the work around!
d
Glad I could help - it was super frustrating. I’d love to hear what the Ory team know about this though!