https://cerbos.dev logo
#help
Title
# help
a

Andrew Young

07/17/2023, 7:51 PM
can the number of clients be configured?
d

Dennis (Cerbos)

07/17/2023, 8:26 PM
Postgres server
max_connections
setting?
a

Andrew Young

07/17/2023, 8:32 PM
thanks that did it!
now i'm hitting the limitation of
"error":"read: connection reset by peer"
probably because of too many concurrent requests
is that a setting that we can tweak too?
d

Dennis (Cerbos)

07/17/2023, 8:36 PM
a

Andrew Young

07/17/2023, 8:37 PM
this doesn't seem to be related to SQL storage.
more to do with HTTP/TCP connections
d

Dennis (Cerbos)

07/17/2023, 8:38 PM
Cerbos uses a connection pool when connecting to a database. You can configure the connection pool settings by adding a
connPool
section to the driver configuration.
I suggest you to tweak
maxIdle
setting
a

Andrew Young

07/17/2023, 8:40 PM
ok let me try that
that didn't have any effect. It's definitely related to too many HTTP connections to the API
the server is just dropping the TCP connection
d

Dennis (Cerbos)

07/17/2023, 8:44 PM
If Postgres drops TCP connections then can you please try
tcp_keepalives_idle
setting
a

Andrew Young

07/17/2023, 8:45 PM
its not Postgres dropping the connection. Its the Cerbos API that is dropping it now.
d

Dennis (Cerbos)

07/17/2023, 8:45 PM
I see
a

Andrew Young

07/17/2023, 8:46 PM
bumping the connPool fixed one bottleneck at the DB level but now i'm reaching another bottleneck at the API
d

Dennis (Cerbos)

07/17/2023, 8:46 PM
Now I got it. Thanks for the explanation.
Copy code
server:
  advanced:
    http:
         ...
    grpc:
         ...
This “advanced” section allow configuring settings of HTTP and GRPC connection. I think the relevant protocol setting is “MaxIdleConnsPerHost”, but it can’t be configured at this moment.
a

Andrew Young

07/17/2023, 10:57 PM
got it. thanks. we might be able to get around this by throttling at the load balancer.