MySql.Data.MySqlClient.MySqlConnection.Open () takes a long time

I have a site mvc.net4 connecting to mysql, on page load I run a query (which cannot be avoided) which is MySql.Data.MySqlClient.MySqlConnection.Open()

very slow, takes 15 seconds in worst case. This page is slow if I use the website after long periods of time. Once I use the website pretty quickly, until a few hours later, I go back and use it. I think because of the cold sessions on the mysql host, it kills all connections in the pool when no one connects for several hours.

enter image description here

I have tried so far with no success:

- For quick access to mysql node, my site does not use dns to connect to mysql server, just ip

- I set timeout minutes for internet in iis settings to 0 in the hope that it will keep the session warm


source to share

All Articles