Connection Reset and CPU load
Posted by: Vladimir Riadchenko
Date: November 18, 2016 02:42AM

I'm using .Net connector 6.9.9 on Windows Server 2008 R2. MySQL 5.7.14 x64
If I set in connection string ConnectionReset=true; than on high concurrent access I see high CPU load by WMIPrvSrv process.
I've found in sources MysqlDefs.cs this line
var searcher = new System.Management.ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem");
I've comment all code in OSDetails property and no more CPU load by WMIPrvSrv.

1. Why detect OS name on each connection - OS will never changed while soft with connector runned. Am I right? Maybe move this code to some place where it can be runned just once for first start?

2. Can MySQL team fix this problem in next Connector release? For me this behaviour very important. My middleware with connector on the same server as MySQL and on high concurrent access server has 100% CPU and performance so bad


For sample you can make test client like this


Parallel.For(0, 50000, (i) =>
{
using (
var objCon =
new MySqlConnection(
"server=localhost;port=3306;user=root;password=root;database=kdm;Character Set=utf8;Pooling=true;Allow user variables=true;ConnectionReset=true;")
)
{
try
{
objCon.Open();

}
catch (Exception ex)
{
Console.WriteLine("Error " + ex.Message);
}
}
});

On Core i7 Windows 10 this code load WMI provider host on 50% CPU


Thanks.

Options: ReplyQuote


Subject
Written By
Posted
Connection Reset and CPU load
November 18, 2016 02:42AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.