SQL Server under the 2014 Database Mail Engine processes consume large amounts of CPU resources

 

Today found a SQL Server database instance to monitor CPU some exceptions, CPU CPU (O / S CPU Utilization) as shown below, consumed by the system and database instance consumption (Instance CPU Utilization) have greater access, the login server checks found Database Mail Engine process consumes 20 percent of CPU resources operations. But it continues to consume so much CPU resources.

 

clip_image001[12]

 

 

 

clip_image002[12]

 

First of all I think about is whether there is the case of mad database mail it? Because the encountered related cases before, because the developers update a script logic bug caused, resulting in a short e-mail mad, causing the Database Mail Engine process consumes a lot of CPU resources, check with the following script. Hair found at most about 200 messages within an hour of the way, so ruled out the situation

 

SELECT CONVERT(VARCHAR(13), send_request_date, 120)
      ,COUNT(*) 
FROM msdb.dbo.sysmail_allitems WITH(NOLOCK)
WHERE send_request_date >= CONVERT(DATETIME, '2020-01-27 00:00:00', 120)
  AND send_request_date <= CONVERT(DATETIME, '2020-03-14 00:00:00', 120)
GROUP BY CONVERT(VARCHAR(13), send_request_date, 120)
ORDER BY CONVERT(VARCHAR(13), send_request_date, 120);

 

clip_image003[12]

 

 

2: system error log and error log DatabaseMail examination found no abnormalities.

 

3: Bug caused.

 

    There are official documents introduced in SQL Server 2016 in the database mail after you send a lot of mail, it may lead to high CPU utilization. But the database instance is SQL Server 2014 (12.0.5000.0), although this has not found an official document under the relevant information SQL Server 2014 Bug, but the urine of Microsoft, basically it is likely that this Bug. Due to the lack of relevant documents, it is possible the current version have not found this Bug. Fix it might not have lost this Bug (I checked all of the patch list, did not mention this).

 

    https://support.microsoft.com/en-nz/help/3197879/fix-sql-server-2016-database-mail-causes-high-cpu-usage-after-many-ema

 

    And the Internet seems to have some friends met the same case.

 

https://feedback.azure.com/forums/908035-sql-server/suggestions/33831496-sql-server-2014-database-mail-causes-high-cpu-usag

 

 

solution

 

If SQL Server 2016, patch Cumulative Update 2 for SQL Server can be resolved after 2016 SP1. But in SQLServer 2014, need to temporarily solve the problem by restarting the mail service.

 

EXEC msdb.dbo.sysmail_stop_sp

 

EXEC msdb.dbo.sysmail_start_sp

Guess you like

Origin www.cnblogs.com/kerrycode/p/12483712.html