As vezes temos operações de disco que chegam a gerar mensagens como a seguinte:
SQL Server has encountered 1 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [X:\Banco\Disk99\DataFiles\Arquivo_do_banco_X_FG_Y_Arquivo_75.ndf] in database [Banco_X] (254). The OS file handle is 0x0000000000009A18. The offset of the latest long I/O is: 0x00000030038000
Muitas vezes isso indica que o sistema de discos não está operando de forma satisfatória e está impactando alguma operação.
A query abaixo tenta ajudar a identificar qual operação DDL ou DML que estava acessando o arquivo naquele momento:
SELECT DB_NAME(mf.database_id) AS [Database]
,mf.physical_name
,r.io_pending
,r.io_pending_ms_ticks
,r.io_type
,fs.num_of_reads
,fs.num_of_writes
,ER.session_id
,ST.TEXT
FROM sys.dm_io_pending_io_requests AS r
INNER JOIN sys.dm_io_virtual_file_stats(NULL, NULL) AS fs ON r.io_handle = fs.file_handle
INNER JOIN sys.master_files AS mf ON fs.database_id = mf.database_id
AND fs.file_id = mf.file_id
INNER JOIN sys.dm_os_schedulers os ON r.scheduler_address = os.scheduler_address
INNER JOIN sys.dm_exec_requests AS ER ON os.scheduler_id = ER.Scheduler_id
CROSS APPLY sys.dm_exec_sql_text(ER.sql_handle) AS ST
ORDER BY r.io_pending_ms_ticks DESC;
go
Lembre-se de trocar o local onde vai salvar o arquivo do evento;
Lembre-se de se estiver usando apenas o arquivo como saída parar o evento pare uma vez ou outra a captura, dependendo da quantidade de execuções e conexões o arquivo pode crescer muito e muito rápido.
se você não configurar o filtro corretamente, você pode para seu ambiente.
A conexao do powerpivot tem que ser alterado apontando para seu servidor.
A algumas semanas atrás eu estava ajudando um cliente a localizar problemas de lentidão no ambiente dele. Não havia um ponto exato, não era sempre na mesma aplicação, muitas vezes nem a mesma unidade, isso ajudava muito na localização do problema,,,
Um dos analistas de desenvolvimento me indagou se o servidor de SQL estava sofrendo com problemas de processador,,, em alguns momentos o servidor apresentava alguns picos em um dos núcleos mas nada muito longo muito menos alarmante.
Com a query abaixo, mostrei que não havia problemas de processamento,,, pelo menos naquele momento…
Select signal_wait_time_ms=sum(signal_wait_time_ms)<br>,'%signal (cpu) waits' = cast(100.0 * sum(signal_wait_time_ms) / sum (wait_time_ms) as numeric(20,2))<br>,resource_wait_time_ms=sum(wait_time_ms - signal_wait_time_ms)<br>,'%resource waits'= cast(100.0 * sum(wait_time_ms - signal_wait_time_ms) / sum (wait_time_ms) as numeric(20,2))<br>From sys.dm_os_wait_stats
O resultado é o seguinte:
Agora vem a pergunta: Legal, mas idaí?
O que nos interessa nesse resultado é o %signal (cpu) waits e o %resource waits.
A matemática é bem simples: quanto mais %recouce waits e menos %signal (cpu) waits melhor, quer dizer que, nesse momento não está havendo problemas de pressão com processador, não quer dizer que daqui a 1 segundo não comece a ter, mas no momento da execução dessa query não havia problema.
English version
A few weeks ago i was helping a client to find a slow problem on his environment. Don´t had a exact point, not always the same apllication, even the same place and this help a lot to find the problem.
One of the developers ask me if the SQL Server had problems with processos pressure,,, in a few moments on the day the server show a top processes in one of the cores, but was not the problem.
With the query below i show that we don´t have any problem with the processor, in that moment…
Select signal_wait_time_ms=sum(signal_wait_time_ms)<br>,'%signal (cpu) waits' = cast(100.0 * sum(signal_wait_time_ms) / sum (wait_time_ms) as numeric(20,2))<br>,resource_wait_time_ms=sum(wait_time_ms - signal_wait_time_ms)<br>,'%resource waits'= cast(100.0 * sum(wait_time_ms - signal_wait_time_ms) / sum (wait_time_ms) as numeric(20,2))<br>From sys.dm_os_wait_stats
The result was:
And then comes the question: Cool, but WTF?
The important is %signal (cpu) waits and %resource waits.
The mathematic is simple: more %recouce waits and lass %signal (cpu) waits is better, in that moment the server don´t have processos pressure.
Sorry about the poor English, i´ll fix at night.
let's make things better
Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.