# MySQL max_connections#

The number of simultaneous connections in Aiven for MySQL depends on the usable memory on the server.

The usable memory is the total memory on the node minus the operating system and management overhead. This overhead is currently estimated as 350 MiB (≈ 0.34 GiB).

The usable memory value is then rounded down to the nearest integer value of GiB.

$$⌊usable\_memory⌋ =$$ $${ RAM - overhead }$$

Note

Independent of the plan, an extra_connection with a value of 1 will be added for the system process.

For plans under 4 GiB of usable memory, the number of allowed connections is $${75}$$ per GiB:

$${max\_connections} =$$ $${75}$$ $${\times ⌊usable\_memory⌋ } + { extra\_connection }$$

As an example, with 4 GiB of total memory, the maximum number of connections is:

$${max\_connections} =$$ $${75}$$ $$\times {⌊4 -}$$ $$\frac{350}{1024}$$ $${⌋ +1}$$

For plans higher or equal to 4 GiB, the number of allowed connections is $${100}$$ per GiB:

$${max\_connections} =$$ $${100}$$ $${\times ⌊usable\_memory⌋ } + { extra\_connection }$$