I have a mvc .net4 website, connecting to mysql, on page load i run a query (which cannot be avoided) for which MySql.Data.MySqlClient.MySqlConnection.Open()
is very slow in worst case taking 15 seconds to open. This page is only slow if i use the website after long periods of time. Once I use the website its pretty fast until hours later I come back and use it. I am thinking its because of cold sessions on mysql host it kills all connections in pool when there is no one connecting for hours.
I have tried following so far with no success:
-For fast access to mysql host my website is not using dns to connect to mysql server rather just the ip
-I set the idle timeout minutes for web in iis settings to 0 in hope that it will keep session pool warm