<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Linux/Unix App total usage with multiple CPUs in Deployment Architecture</title>
    <link>https://community.splunk.com/t5/Deployment-Architecture/Linux-Unix-App-total-usage-with-multiple-CPUs/m-p/98355#M3641</link>
    <description>&lt;P&gt;Hi, so I have a question regarding CPU usage and virtualization/multiple processors.&lt;/P&gt;

&lt;P&gt;My environment:&lt;BR /&gt;
Red hat 6 Virtual Machine&lt;BR /&gt;
2 CPU&lt;BR /&gt;
8 GB RAM&lt;/P&gt;

&lt;P&gt;I was testing some basic alerting using the *Nix Addon for Splunk. The app includes a cpu monitor script out of the box using top. A snag I hit was such: If I monitor for a process taking up 90%+ CPU over a time period that doesn't necessarily mean the VM is capped/flatlined on CPU. For a 2 CPU system in this scenario it's possible that only ~70% of total CPU is being used (90% - 100% of one CPU + what the rest of the processes are using on the second processor). This would all be dependent on how an application runs, how many processors are on the box, etc.&lt;/P&gt;

&lt;P&gt;I'm trying to find a more reliable way to monitor total usage. Has anyone had experiences similar to this? I've been giving:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=os sourcetype=cpu host=SplunkLab03  | multikv fields pctIdle  | where pctIdle&amp;lt;10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;A shot and it seems to work well but would appreciate a verification before moving forward.&lt;/P&gt;

&lt;P&gt;The script I use to run up cpu is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;while true;
do true;
done
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 Oct 2012 20:08:18 GMT</pubDate>
    <dc:creator>sherbuckap</dc:creator>
    <dc:date>2012-10-22T20:08:18Z</dc:date>
    <item>
      <title>Linux/Unix App total usage with multiple CPUs</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Linux-Unix-App-total-usage-with-multiple-CPUs/m-p/98355#M3641</link>
      <description>&lt;P&gt;Hi, so I have a question regarding CPU usage and virtualization/multiple processors.&lt;/P&gt;

&lt;P&gt;My environment:&lt;BR /&gt;
Red hat 6 Virtual Machine&lt;BR /&gt;
2 CPU&lt;BR /&gt;
8 GB RAM&lt;/P&gt;

&lt;P&gt;I was testing some basic alerting using the *Nix Addon for Splunk. The app includes a cpu monitor script out of the box using top. A snag I hit was such: If I monitor for a process taking up 90%+ CPU over a time period that doesn't necessarily mean the VM is capped/flatlined on CPU. For a 2 CPU system in this scenario it's possible that only ~70% of total CPU is being used (90% - 100% of one CPU + what the rest of the processes are using on the second processor). This would all be dependent on how an application runs, how many processors are on the box, etc.&lt;/P&gt;

&lt;P&gt;I'm trying to find a more reliable way to monitor total usage. Has anyone had experiences similar to this? I've been giving:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=os sourcetype=cpu host=SplunkLab03  | multikv fields pctIdle  | where pctIdle&amp;lt;10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;A shot and it seems to work well but would appreciate a verification before moving forward.&lt;/P&gt;

&lt;P&gt;The script I use to run up cpu is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;while true;
do true;
done
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Oct 2012 20:08:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Linux-Unix-App-total-usage-with-multiple-CPUs/m-p/98355#M3641</guid>
      <dc:creator>sherbuckap</dc:creator>
      <dc:date>2012-10-22T20:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Linux/Unix App total usage with multiple CPUs</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Linux-Unix-App-total-usage-with-multiple-CPUs/m-p/98356#M3642</link>
      <description>&lt;P&gt;On a multicore system, load is roughly additive.  So I would simply add values from all CPUs ( &lt;CODE&gt;sum(pctIdle) by _time&lt;/CODE&gt;, then divide by number of CPUs ( &lt;CODE&gt;| eventstats dc(CPU)&lt;/CODE&gt;).   On the other hand, the &lt;CODE&gt;sar&lt;/CODE&gt; utility on Linux that sourcetype cpu uses includes the aggregation CPU="all".  This saves you from the burden (and complicates the filter if you are to calculate on your own).  Hence,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=os sourcetype=cpu host=SplunkLab03 CPU=all
| where pctIdle&amp;lt;10
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Oct 2015 20:33:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Linux-Unix-App-total-usage-with-multiple-CPUs/m-p/98356#M3642</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2015-10-20T20:33:56Z</dc:date>
    </item>
  </channel>
</rss>

