Monitor Core utilization in Solaris Sparc


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Monitor Core utilization in Solaris Sparc
# 1  
Old 03-17-2015
Tools Monitor Core utilization in Solaris Sparc

I am trying to read the Sparc HW counter using the following command:
Code:
cpustat -c Instr_cnt .1

This command will be running forever (for some time until interrupted by user). Sample output is:
Code:
   time  cpu   event      pic1      
  1.011   0      tick      6450    
  1.011   1       tick      9681   
  1.011   2       tick      2015  
  1.012   3       tick       535 
  1.012   4       tick       615   
   1.012   5      tick      7513  
   1.012   6      tick       615 
   1.013   7      tick      5187 
   1.013   8      tick       615 
   1.013   9      tick       615  
  1.013  10       tick       615   
   1.014  11      tick     60077  
  1.014  12       tick       438  
  1.014  13       tick       615  
  1.014  14       tick       615  
  1.015  15       tick       615
   1.015  16      tick       615 
   1.015  17       tick       438  
   1.016  18       tick       615  
   1.016  19       tick       615
  ^C

\

I am trying to get every 4 cpu's in a core (each core has 4 cpus), add the number in pic1 and average them. Once the average reaches some threshold number, I want to do some load balancing. I think the logic is: put all the elements from line 2 in an array, and then add every 4 of them. Looking for an output like:
Code:
**Core#      Average# of Inst    Utilization (#ofInst/cpu_cycle_perSec)**
   Core_0         xxxxxxxx             10%
   Core_1         xxxxxxxx             20%  
   and so on....

I am novice in coding and if anyone could help me with some simple direction to do this, that would be great. This can be done in shell/python.
Thanks in advance.

Last edited by Zam_1234; 03-17-2015 at 02:30 AM.. Reason: Formatting
# 2  
Old 03-17-2015
This should give the first two columns. It is unclear how you want to compute the third one.

Code:
nawk '
BEGIN {
  printf("%-8s %-8s\n","Core_#", "Inst avg");
}
{
  c=($2+1)%4;
  s+=$4
  if(c==0)
  {
    printf("Core_%03d %8d\n", (($2+1)/4)-1, s);
    s=0
  }
}
'


Last edited by jlliagre; 03-17-2015 at 09:49 AM.. Reason: Start core numbering at 0
# 3  
Old 03-17-2015
Thanks.
What if i wnated to run the cpustat command for every .1 second but make the average core utilization every secind and make decision accordingly?
# 4  
Old 03-17-2015
Quote:
Originally Posted by Zam_1234
Thanks.
What if i wnated to run the cpustat command for every .1 second but make the average core utilization every secind and make decision accordingly?
Use SAR for that.

And I do wonder what the point of this is. CPUs are bought to be used.
# 5  
Old 03-17-2015
Quote:
Originally Posted by achenle
Use SAR for that.

And I do wonder what the point of this is. CPUs are bought to be used.
I don't think SAR is available for Solaris SPARC.
The CPU pooling is for a work that I am trying to do, thus utilizing a part of the total available.
Smilie
# 6  
Old 03-17-2015
Quote:
Originally Posted by Zam_1234
Thanks.
What if i wnated to run the cpustat command for every .1 second but make the average core utilization every secind and make decision accordingly?
What's the point of a 100 ms sampling rate if you look for a 1 second average anyway?

Note that sar is available for Solaris and has always been regardless of the architecture but it is quite outdated with modern hardware and is unsuitable to per core monitoring.
# 7  
Old 03-17-2015
Quote:
Originally Posted by jlliagre
What's the point of a 100 ms sampling rate if you look for a 1 second average anyway?

Note that sar is available for Solaris and has always been regardless of the architecture but it is quite outdated with modern hardware and is unsuitable to per core monitoring.
I am trying to read the average of 100ms sampling every 1 second and see what sort of average utilization we are seeing per core. so after 1 second I can make decision that whether I add another CPU to the pool or not (for example).

[not sure whether this answers the question, but feel free to provide your opinions...:-)]
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

SNMP - cpu core information for Sun SPARC machine

Dears, I'm looking for getting CPU cores information of Sun machines (like: SunFire V880, Fujitsu SPARC T5120, ...) via SNMP, unfortunately i couldn't find the proper OID for that. Can anyone help me with this ? Thanks, (1 Reply)
Discussion started by: Anti_Evil
1 Replies

2. Shell Programming and Scripting

Looking for shell script to monitor CPU utilization and send mail once exceed 75%

Dear Group, I'm look for shell script to Monitor CPU usage and send mail once it exceed 75% I'm running Suse10.4. (3 Replies)
Discussion started by: clfever
3 Replies

3. UNIX for Dummies Questions & Answers

How to monitor per core CPU utilization?

I can use top to see the overall cpu utilization in the system but i m using a system with 24 cores .How would i monitor each core utilization ? The system is used as Oracle VM Server for Virtualization. My distribution details. # lsb_release -a LSB Version: ... (8 Replies)
Discussion started by: pinga123
8 Replies

4. UNIX for Advanced & Expert Users

Monitor % utilization of the network card

Hello, How to we typically monitor the % of utilization of network cards on a Unix box,basically the % utilization of the bytes transfered of the network card. This is required on all the flavours of OS - HP, AIX, RHEL, Sun etc. Please let me know. Thanks. (1 Reply)
Discussion started by: devtakh
1 Replies

5. UNIX for Dummies Questions & Answers

can I emulate solaris/sparc on virtualbox? Or other emulator to run solaris for sparc in my win7 PC?

Hi Gurus can I emulate solaris/sparc on virtualbox? Or other emulator to run solaris for sparc in my win7 PC? regards, Israel. (9 Replies)
Discussion started by: iga3725
9 Replies

6. Shell Programming and Scripting

need help for scrip to monitor disk utilization

Hi, I need help to write a script which will monitor disk utilization. Please suggest the best approach to achive this. I am thinking of having sleep inside the script which will run for(eg.) 60 secs and then disk utilization will be checked and depends on the % usage of disk mail will... (1 Reply)
Discussion started by: sunilmenhdiratt
1 Replies

7. Emergency UNIX and Linux Support

How to monitor a process memory utilization?

hi frnds, I want to monitor a particular process very closly on how much memory it is taking. i tried with TOP and PRSTAT commands that is not giving what exactly i need. In my application, there is a memory leak happening, i want to know when it is occuering, means which transcation is... (9 Replies)
Discussion started by: vij_krr
9 Replies

8. Programming

how to monitor the child process on which cpu core

Hi all. Sorry to express my questions wrongly in my early post,I repost my question again here. My pc has dual core, I wirte an application with two process, parents process and child process. My quetion is how to realize :if the child process is on core 0,it will tell me I'm on core 0,if it... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

9. Linux

fedora core 6 not supported for acer lcd monitor

hi all i brought a new acer 17" widescreen lcd monitor . fedora core linux 6 in not displaying on the monitor . giving a error input not supported please let me know wht i can do (1 Reply)
Discussion started by: nageshrk
1 Replies
Login or Register to Ask a Question