timer ticks in /proc/stat - more differences between SLES and RHEL?
I'm hacking around with CPU utilization numbers from /proc/stat with this little script: # cat getticks #!/bin/bash echo getting one set of data statOut1=`egrep '^cpu ' /proc/stat` echo sleeping 5 seconds and getting another set of data sleep 5 statOut2=`egrep '^cpu ' /proc/stat` nums1=`echo $statOut1 | grep ^cpu | sed -e 's/cpu\s*//g' -e 's/ /+/g'` let sum1=$nums1 nums2=`echo $statOut2 | grep ^cpu | sed -e 's/cpu\s*//g' -e 's/ /+/g'` let sum2=$nums2 let totalTicks=$sum2-$sum1 echo statOut1 = $statOut1 echo statOut2 = $statOut2 echo nums1 = $nums1 echo nums2 = $nums2 echo totalTicks = $totalTicks On a SLES 11 SP2 system, with 5 vCPUs, I get the expected output: # ./getticks getting one set of data sleeping 5 seconds and getting another set of data statOut1 = cpu 251 8 170 857508 145 2 7 32 0 0 statOut2 = cpu 251 8 170 860009 145 2 7 32 0 0 nums1 = 251+8+170+857508+145+2+7+32+0+0 nums2 = 251+8+170+860009+145+2+7+32+0+0 totalTicks = 2501 2501 ~= 5 seconds * 5 CPUs * 100 ticks/sec On a RHEL 6.3 system (2 vCPUs), I get a *slightly* different number: # ./getticks getting one set of data sleeping 5 seconds and getting another set of data statOut1 = cpu 13059 57057 56528 4 0 2740 3152 3130 0 statOut2 = cpu 13059 57057 56529 4 0 2740 3152 3130 0 nums1 = 13059+57057+56528+4+0+2740+3152+3130+0 nums2 = 13059+57057+56529+4+0+2740+3152+3130+0 totalTicks = 1 HUH? Does RHEL not count ticks in /proc/stat? Any help will be appreciated. Mike MacIsaac mikemac at-sign us.ibm.com -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: timer ticks in /proc/stat - more differences between SLES and RHEL?
Interesting because when I ran the same script on a RHEL 5.9 guest (w/ 2 vCPUs), we get: ./gettricks.sh getting one set of data sleeping 5 seconds and getting another set of data statOut1 = cpu 60259 128520 96523 256447792 415684 8000 15453 134955 statOut2 = cpu 60259 128520 96524 256448793 415686 8000 15453 134955 nums1 = 60259+128520+96523+256447792+415684+8000+15453+134955 nums2 = 60259+128520+96524+256448793+415686+8000+15453+134955 totalTicks = 1004 Do not have a RHEL 6.3 system to compare with :-(. James Chaplin Systems Programmer, MVS, zVM zLinux Base Technologies, a CA Technologies Company Supporting the zSeries Platform Team -Original Message- From: Linux on 390 Port [mailto:LINUX-390@VM.MARIST.EDU] On Behalf Of Michael MacIsaac Sent: Friday, May 17, 2013 10:30 AM To: LINUX-390@VM.MARIST.EDU Subject: timer ticks in /proc/stat - more differences between SLES and RHEL? I'm hacking around with CPU utilization numbers from /proc/stat with this little script: # cat getticks #!/bin/bash echo getting one set of data statOut1=`egrep '^cpu ' /proc/stat` echo sleeping 5 seconds and getting another set of data sleep 5 statOut2=`egrep '^cpu ' /proc/stat` nums1=`echo $statOut1 | grep ^cpu | sed -e 's/cpu\s*//g' -e 's/ /+/g'` let sum1=$nums1 nums2=`echo $statOut2 | grep ^cpu | sed -e 's/cpu\s*//g' -e 's/ /+/g'` let sum2=$nums2 let totalTicks=$sum2-$sum1 echo statOut1 = $statOut1 echo statOut2 = $statOut2 echo nums1 = $nums1 echo nums2 = $nums2 echo totalTicks = $totalTicks On a SLES 11 SP2 system, with 5 vCPUs, I get the expected output: # ./getticks getting one set of data sleeping 5 seconds and getting another set of data statOut1 = cpu 251 8 170 857508 145 2 7 32 0 0 statOut2 = cpu 251 8 170 860009 145 2 7 32 0 0 nums1 = 251+8+170+857508+145+2+7+32+0+0 nums2 = 251+8+170+860009+145+2+7+32+0+0 totalTicks = 2501 2501 ~= 5 seconds * 5 CPUs * 100 ticks/sec On a RHEL 6.3 system (2 vCPUs), I get a *slightly* different number: # ./getticks getting one set of data sleeping 5 seconds and getting another set of data statOut1 = cpu 13059 57057 56528 4 0 2740 3152 3130 0 statOut2 = cpu 13059 57057 56529 4 0 2740 3152 3130 0 nums1 = 13059+57057+56528+4+0+2740+3152+3130+0 nums2 = 13059+57057+56529+4+0+2740+3152+3130+0 totalTicks = 1 HUH? Does RHEL not count ticks in /proc/stat? Any help will be appreciated. Mike MacIsaac mikemac at-sign us.ibm.com -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/ -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: timer ticks in /proc/stat - more differences between SLES and RHEL?
RHEL 6.4 cat /etc/redhat-release;./getticks.sh Red Hat Enterprise Linux Server release 6.4 (Santiago) getting one set of data sleeping 5 seconds and getting another set of data statOut1 = cpu 31860 18874 14917 835252 84240 869 1430 8480 0 statOut2 = cpu 31869 18874 14924 836234 84242 869 1430 8481 0 nums1 = 31860+18874+14917+835252+84240+869+1430+8480+0 nums2 = 31869+18874+14924+836234+84242+869+1430+8481+0 totalTicks = 1001 -Original Message- From: Linux on 390 Port [mailto:LINUX-390@VM.MARIST.EDU] On Behalf Of CHAPLIN, JAMES (CTR) Sent: Friday, May 17, 2013 10:59 AM To: LINUX-390@VM.MARIST.EDU Subject: Re: timer ticks in /proc/stat - more differences between SLES and RHEL? Interesting because when I ran the same script on a RHEL 5.9 guest (w/ 2 vCPUs), we get: ./gettricks.sh getting one set of data sleeping 5 seconds and getting another set of data statOut1 = cpu 60259 128520 96523 256447792 415684 8000 15453 134955 statOut2 = cpu 60259 128520 96524 256448793 415686 8000 15453 134955 nums1 = 60259+128520+96523+256447792+415684+8000+15453+134955 nums2 = 60259+128520+96524+256448793+415686+8000+15453+134955 totalTicks = 1004 Do not have a RHEL 6.3 system to compare with :-(. James Chaplin Systems Programmer, MVS, zVM zLinux Base Technologies, a CA Technologies Company Supporting the zSeries Platform Team -Original Message- From: Linux on 390 Port [mailto:LINUX-390@VM.MARIST.EDU] On Behalf Of Michael MacIsaac Sent: Friday, May 17, 2013 10:30 AM To: LINUX-390@VM.MARIST.EDU Subject: timer ticks in /proc/stat - more differences between SLES and RHEL? I'm hacking around with CPU utilization numbers from /proc/stat with this little script: # cat getticks #!/bin/bash echo getting one set of data statOut1=`egrep '^cpu ' /proc/stat` echo sleeping 5 seconds and getting another set of data sleep 5 statOut2=`egrep '^cpu ' /proc/stat` nums1=`echo $statOut1 | grep ^cpu | sed -e 's/cpu\s*//g' -e 's/ /+/g'` let sum1=$nums1 nums2=`echo $statOut2 | grep ^cpu | sed -e 's/cpu\s*//g' -e 's/ /+/g'` let sum2=$nums2 let totalTicks=$sum2-$sum1 echo statOut1 = $statOut1 echo statOut2 = $statOut2 echo nums1 = $nums1 echo nums2 = $nums2 echo totalTicks = $totalTicks On a SLES 11 SP2 system, with 5 vCPUs, I get the expected output: # ./getticks getting one set of data sleeping 5 seconds and getting another set of data statOut1 = cpu 251 8 170 857508 145 2 7 32 0 0 statOut2 = cpu 251 8 170 860009 145 2 7 32 0 0 nums1 = 251+8+170+857508+145+2+7+32+0+0 nums2 = 251+8+170+860009+145+2+7+32+0+0 totalTicks = 2501 2501 ~= 5 seconds * 5 CPUs * 100 ticks/sec On a RHEL 6.3 system (2 vCPUs), I get a *slightly* different number: # ./getticks getting one set of data sleeping 5 seconds and getting another set of data statOut1 = cpu 13059 57057 56528 4 0 2740 3152 3130 0 statOut2 = cpu 13059 57057 56529 4 0 2740 3152 3130 0 nums1 = 13059+57057+56528+4+0+2740+3152+3130+0 nums2 = 13059+57057+56529+4+0+2740+3152+3130+0 totalTicks = 1 HUH? Does RHEL not count ticks in /proc/stat? Any help will be appreciated. Mike MacIsaac mikemac at-sign us.ibm.com -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/ -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/ If you are not the addressee, please inform us immediately that you have received this e-mail by mistake, and delete it. We thank you for your support. -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: timer ticks in /proc/stat - more differences between SLES and RHEL?
James, Emmett, Thanks for the replies. Good to know that an older and a new RHEL seem to come up with the right answer (I assume you both have 2 vCPUs). Just to be sure, I tried again on my reference system, and got similar results: # cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.3 (Santiago) # ./getticks getting one set of data sleeping 5 seconds and getting another set of data statOut1 = cpu 13191 57057 57033 4 0 2781 3194 3158 0 statOut2 = cpu 13191 57057 57033 4 0 2781 3194 3158 0 nums1 = 13191+57057+57033+4+0+2781+3194+3158+0 nums2 = 13191+57057+57033+4+0+2781+3194+3158+0 totalTicks = 0 Mike MacIsaac mikemac at-sign us.ibm.com -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: timer ticks in /proc/stat - more differences between SLES and RHEL?
Hello list, Aha moment - a while back I reported that vmstat 1 2 was core dumping on RHEL 6.3. I got a reply this is a known issue and that there is a fix. This must be the same issue (without a proper tick count, the code might be trying to divide by 0). Another mystery solved. I think it's time to move to RHEL 6.4 ... Thanks again for all quick replies. Mike MacIsaac mikemac at-sign us.ibm.com -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: timer ticks in /proc/stat - more differences between SLES and RHEL?
The differences you're seeing ... some are lag-time as changes get rolled into the kernel and utilities, but others may be variances from a standard. (or lag-time in keeping up with the standard) Standard ... is there? Why ... yes, there is! The Linux Standard Base was created to lower the overall costs of supporting the Linux platform. By reducing the differences between individual Linux distributions, the LSB greatly reduces the costs involved with porting applications to different distributions, as well as lowers the cost and effort involved in after-market support of those applications. http://www.linuxfoundation.org/collaborate/workgroups/lsb And it appears that IBM, SuSE, and RedHat are all supporting members of the LF. -- R; On Fri, May 17, 2013 at 1:23 PM, Michael MacIsaac mike...@us.ibm.com wrote: James, Emmett, Thanks for the replies. Good to know that an older and a new RHEL seem to come up with the right answer (I assume you both have 2 vCPUs). Just to be sure, I tried again on my reference system, and got similar results: # cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.3 (Santiago) # ./getticks getting one set of data sleeping 5 seconds and getting another set of data statOut1 = cpu 13191 57057 57033 4 0 2781 3194 3158 0 statOut2 = cpu 13191 57057 57033 4 0 2781 3194 3158 0 nums1 = 13191+57057+57033+4+0+2781+3194+3158+0 nums2 = 13191+57057+57033+4+0+2781+3194+3158+0 totalTicks = 0 Mike MacIsaac mikemac at-sign us.ibm.com -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/ -- -- R; -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/