Cpu information using DMVs SQL Server

Miiimy7 41 Reputation points
2021-04-13T21:20:58.563+00:00

Hello guys!

i want to retrieve information about CPU (%processor time, ...) by using DMVs. I already know about sys.dm_os_ring_buffers but the interval during which informations are collected is pretty long (1 min) . Anything can happen in one minute!

If you have some tips, it would be cool!

Thank you very much

Developer technologies Transact-SQL
SQL Server Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2021-04-14T06:00:00.89+00:00

    SQL Server is a server to manage data, not to monitor OS or hardware.

    Implement a monitor by installing a monitoring software, e.g. Windows PerfMon or some open source software like Nagios.

    1 person found this answer helpful.

  2. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2021-04-14T21:19:57.943+00:00

    Have a lot at the system function @@CPU_BUSY. This is a very ancient one, and you will have to read up a little on it to make sense out of it.


  3. Cris Zhan-MSFT 6,661 Reputation points
    2021-04-15T06:58:02.733+00:00

    Hi,

    If you need to monitor the resource usage of SQL Server in real time, it is more convenient to use tools from outside of SQL Server.

    Using the performance dashboard (reports) in SSMS, and the DMVs of SQL Server itself, you can better understand the performance of SQL Server over a period of time.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.