0

I have a fairly busy server, with about 200 qps and a read/write ratio of about 10, running on MySQL 5.1.73 64bit on CentOs 6.6

Most aspects are optimized, however, whenever i restart mysql, it goes to about 80% of available connections. After 10-30 seconds it goes down to about 5-10% and stays there with no other unusual peaks.

While this is not a critical concern and it doesn't affect the server too often, I was wondering why this is happening and if the MySQL server can be optimized to better face the 10-20 seconds following a restart... This would at least help me have a more realistic figure of the highest usage of available connections, which is now set to whatever number of connection MySQL goes to in the first 10 seconds after restart.

--EDIT-- The issue is probably connected with what Tero said in his answer, however I am also looking for an improvement...

radoo
  • 3
  • 3

1 Answers1

2

Most likely this is due to the MySQL caches / buffer pool being empty after restart, and therefore the first queries go straight to the hard disk. This makes the queries last longer, and therefore connections last longer -> there are more active connections at a time.

You can verify this by checking disk I/O when you restart server and when it has been up for some time. You should see a clear difference.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63
  • Thank you for the answer, I was thinking along the same lines but I formulated the question poorly. I am also looking for a possible solution to improve the described situation... – radoo Jan 08 '15 at 16:54
  • Well, as far as I know, there isn't any method of warming up the cache at startup. The only thing you can do is to restart the server at the most quiet time, so that it has least effect on the service. – Tero Kilkanen Jan 09 '15 at 00:20