Wednesday, December 16, 2015

performance: msdb.dbo.sp_readrequest;1 – long running process

When monitoring the new installed version of SQL 2008 R2 SP1, I have encountered that Database mail leaves a hung process few minutes. This doesn’t do any blockages or other trouble to your SQL installation, either that it is anoying to see over and over again this long running process. In order to get rid off it, just check the system parameter value for “DatabaseMailExeMinimumLifeTime” running the following query:
Use msdb
GO
exec sysmail_help_configure_sp 'DatabaseMailExeMinimumLifeTime'
GO
The default setting will be 600. You need to change it to a lower period.
Use msdb
GO
exec sysmail_configure_sp 'DatabaseMailExeMinimumLifeTime', 30
GO

=================================================================

Anyone get a solution to this one?  I'm getting the same hung process today after an upgrade to 2005 SP3

Had a look at the mail logs - the process runs for 10minutes.  Which is coincidentally the same as the setting for 'Database Mail Executable Minimum Lifetime (seconds)'

When I adjusted 'Database Mail Executable Minimum Lifetime (seconds)' down from the 10 minutes default to 10 seconds everything went back to normal.  Much happiness for me. 
I am troubleshooting a similar issue, whereby the Performance Dashboard Reports (the Query Duration Component) show that a stored procedure used by Database Mail is the most costly query. It appears to be a service broker wait request, i.e. the database mail queue is waiting for further requests to process.

Based on your comments this seem like a plausable solutiuon. I have adjusted the very same Database Mail property to see if it clears this issue.