CPU Utilization

  • Hi All,

    Is there anyway to find out the total CPU Utilization of the server through any command (SQL Server command / OS Command) ?

    I have tried xp_cmdshell 'tasklist /V', but it gives only cpu time...

    Please help

    thanks in advance

     


    subban

  • You can store perfmon output to a file and look at that.

    What are you trying to accomplish?

  • Ok, I need to get total cpu utilisation of the server each hour. I was calling WMI classess through T-SQL for this purpose. But in windows 2003 WMI access is denied by default.

    I am looking for an alternate approach... can u help me in this ?


    subban

  • WMI is probably the best way. If you cannot get access, can you setup PerfMon to get this information and log it?

  • If you machine is only used for SQL Server you might consider looking at the  @@CPU_BUSY variable.  This variable contains the number of milliseconds of CPU used by SQL Server since it started.  By comparing the amount from one hour to the next you should be able to get a rough idea of the average CPU utilization.

    Gregory A. Larsen, MVP

  • Hi,

    I would opt for WMI. Go to Microsoft website. Download Scriptomatic tool (search by the keyword "scriptomatic"). Install it. Installing consists just of unzipping the tool and the readme. Double-click on the tool Scriptomatic.hta. In the open window select your counter in the dropdown. You may want to select WIN32_PerfRowData_PerfOS_Processor

    Once you select, the script is written for you in the window! You can save it, modify it, run it, save as VBS file and run in a batch, add input/output. You will like it.

    Regards,Yelena Varsha

  • OK.... thanks to all.

    What about scheduling system monitor and get the output to a csv file. Tne read from that csv file..Any issues, if it is a production box ?

     

     


    subban

  • Performance Monitor can log directly to SQL server so you may as well make use of this and read the data directly from the table created.

  • THANKS TO ALL.....good info


    subban

  • We use Nagios to monitor our systems. With nagiostat/rrdtool you can make historical charting of performance. We have charts of our AS400 performance, Windows AD, SQL Server, Cisco devices, temp in server rooms, etc. Anything that can be logged in Windows performance monitor/SNMP is available to the nagios windows client for collection/alerts/metrics. As we grew in the company it got too ridiculous to look at perf monitor, vmstat, iseries navigator, OEM, etc. in each machine so we went to a central collection system that looks at everything.

    It probably sounds elaborate - but it wasn't that difficult to do and the advantages are enormous.

  • Hi all....

    The above methods wats mentioned are good in finding out the CPU utilization.Can anyone advice me how i can monitor all the processes consuming CPU usage continuously (by the use of some job scheduled to execute a procedure which determines the CPU usage)and can keep some threshold like 70% and if CPU usage crosses that threshold I should be able to get an alert.

    Thanks in Advance...

    Vinay

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply