Sql-server – Signal wait always high

performancesql serversql-server-2012troubleshooting

I'm not sure if this is the right place to ask this question, so apologies in advance if not.

Problem I'm facing is: One of my server's signal wait floats at around %35 and won't go down.

Top 3 waits are:

SOS_SCHEDULER_YIELD (55%)

OLEDB (10%)

ASYNC_NETWORK_IO (6%)

CPU utilization of the instance is at around 22%.

What might be causing this to happen?. Where should I look at to investigate further?
I'm on SQL Server 2012.

Thanks all.

Best Answer

Based on your comment about the "unwieldy" SP I'd almost guarantee that is at least part of your problem. Try running the following query replacing DBName and SPName as appropriate.

USE DBName
GO

SELECT SUBSTRING(text, statement_start_offset/2,
        CASE WHEN statement_end_offset = -1 THEN 999999 ELSE
            (statement_end_offset-statement_start_offset)/2-1 END)
    ,*
FROM sys.dm_exec_query_stats
CROSS APPLY sys.dm_exec_sql_text(sql_handle) query
WHERE query.dbid = db_id('DBName')
  AND query.objectid = object_id('SPName')

This will break down your SP into pieces and you can sort by one of the elapsed_time, logical_reads columns, or total_worker (cpu) columns to decide what specific commands you want to work on first. The actual command will be the first column.

By breaking it down like this you can start picking off the low hanging fruit and speed the over all SP a bit at a time. This doesn't of course take the place of reviewing the whole thing at once. For example it will help to reduce the speed of a query that's being run a dozen times in the SP, it will help even more if you can figure out a way to run it only once (personal recent experience).

Now to be fair this doesn't answer your original question and it is more meant as a response to the comment and a helpful way to deal with a "problem" sp.