MySQL Max-Connections memory usage...


Well-known member
So apparently its not a bug. MySQL allocates memory based on server "size". Some settings can easily allocate a lot more memory if above a certain point. Max-Connections at 300 the server uses around 150 mb to start at 310 it uses 450 mb to start.

At 1GB of ram I have just enough to play with. But no config out of the box is pushing 500 mb for MySQL, under load testing this can easily start swapping and performance goes to crap. The percona config generator added to this usage (around 700mb) even at lower innodb buffer settings.

So for giggles I replace everything except the InnoDB settings to the settings from MariaDB's shipped medium config

Under a 250 user, 1000 connection load test the server didn't use any swap, total usage 900mb of ram with mysql starting at 150 growing to around 300mb.

The server performed great considering. So I went chasing what settings were throwing the usage up and it was none of the ones I thought. Just curious if anyone had danced this dance before?