https://github.com/osquery/osquery logo
Title
j

Juan Alvarez

09/06/2021, 1:34 PM
Hi all, is there any guidance on how to configure the parameters
FLEET_MYSQL_MAX_IDLE_CONNS
and
FLEET_MYSQL_MAX_OPEN_CONNS
? I started to see
Error 1040: Too Many Connections
along with
Authentication Error: Finding Host
so i think that MySQL was dropping an excessive amount of connections coming from the FleetDM. Our configuration was
FLEET_MYSQL_MAX_IDLE_CONNS=50
and Max Open
FLEET_MYSQL_MAX_OPEN_CONNS=400
which i think it was overwhelming the mysql that has a
max_connections
variable of 151. Once i lowered `FLEET_MYSQL_MAX_OPEN_CONNS=100`i stopped seeing the errors. The question is, what is a typical configuration for those parameters when having deployments of several thousands clients? Should we configure
FLEET_MYSQL_MAX_OPEN_CONNS
close to the
max_connections
value in MySQL? And what would be FleetDM's behavior if he needs to check in the database but the max amount of connections is reached? Any guidance is appreciated!
m

Martavis Parker

09/07/2021, 7:27 PM
Hi Juan, we're digging into this to provide some guidance for you. Thank you for your patience. And let us know if you find anything in the meantime. We would really appreciate it.
j

Juan Alvarez

09/08/2021, 10:33 AM
Thanks Martavis, appreciate any insight
z

zwass

09/09/2021, 9:03 PM
The best thing to do is limit the open connections such that between all your Fleet servers you don't exceed the
max_connections
. So
FLEET_MYSQL_MAX_OPEN_CONNS=max_connections/# of Fleet servers
.
🥘 1
j

Juan Alvarez

09/10/2021, 3:10 PM
Thanks !
j

JojoD

04/13/2022, 1:22 PM
Hi @zwass, in the comment above, when you say to add
FLEET_MYSQL_MAX_OPEN_CONNS=max_connections
, it will automatically read the value stored in the
max_connections
variable of the DB? .... what would be the case where the
FLEET_MYSQL_MAX_OPEN_CONNS
is lower than the connections of the DB?