<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: What does 100% CPU usage mean?</title>
	<atom:link href="http://archisgore.com/2010/08/17/what-does-100-cpu-usage-mean/feed/" rel="self" type="application/rss+xml" />
	<link>http://archisgore.com/2010/08/17/what-does-100-cpu-usage-mean/</link>
	<description>Archis&#039;s journey towards becoming a Jedi</description>
	<lastBuildDate>Thu, 04 Apr 2013 13:53:22 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: archisgore</title>
		<link>http://archisgore.com/2010/08/17/what-does-100-cpu-usage-mean/#comment-297</link>
		<dc:creator><![CDATA[archisgore]]></dc:creator>
		<pubDate>Thu, 19 Aug 2010 06:52:38 +0000</pubDate>
		<guid isPermaLink="false">http://archisgore.com/?p=388#comment-297</guid>
		<description><![CDATA[LOL. That&#039;s certainly true. :-) I started with 10% and hence somehow felt symmetrical to go back down to 10%. One of those times when reality and a poetic style of writing conflict.]]></description>
		<content:encoded><![CDATA[<p>LOL. That&#8217;s certainly true. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I started with 10% and hence somehow felt symmetrical to go back down to 10%. One of those times when reality and a poetic style of writing conflict.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prashanth</title>
		<link>http://archisgore.com/2010/08/17/what-does-100-cpu-usage-mean/#comment-296</link>
		<dc:creator><![CDATA[Prashanth]]></dc:creator>
		<pubDate>Thu, 19 Aug 2010 06:26:09 +0000</pubDate>
		<guid isPermaLink="false">http://archisgore.com/?p=388#comment-296</guid>
		<description><![CDATA[Something is broken if you are idling at 10%.]]></description>
		<content:encoded><![CDATA[<p>Something is broken if you are idling at 10%.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: archisgore</title>
		<link>http://archisgore.com/2010/08/17/what-does-100-cpu-usage-mean/#comment-295</link>
		<dc:creator><![CDATA[archisgore]]></dc:creator>
		<pubDate>Thu, 19 Aug 2010 05:24:18 +0000</pubDate>
		<guid isPermaLink="false">http://archisgore.com/?p=388#comment-295</guid>
		<description><![CDATA[I&#039;ve been thinking about this a lot over the past few days. Mainly because I did work on something that was a fan-in model of coding. Basically, any webpage today fans in data from multiple backend sources and generates something consumable by outsiders.

A lot of wakeups happen when you interleave CPU/local operations with the read/write calls. So you have your thread waking up intermittently for one or two additions before sleeping again.

To me an ideal CPU/IO graph would be a lot of 10%&#039;s while the necessary data to render the page is being brought in, then a sudden burst of 100% (or whatever the OS can possibly allocate), and then back down to 10-20% which would be kee-alive mode.

The only reason I posted this was because I did write code once which exactly met these conditions, and put three testers and two developers on a wild goose chase finding out why we were getting such bad numbers and such good response times.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve been thinking about this a lot over the past few days. Mainly because I did work on something that was a fan-in model of coding. Basically, any webpage today fans in data from multiple backend sources and generates something consumable by outsiders.</p>
<p>A lot of wakeups happen when you interleave CPU/local operations with the read/write calls. So you have your thread waking up intermittently for one or two additions before sleeping again.</p>
<p>To me an ideal CPU/IO graph would be a lot of 10%&#8217;s while the necessary data to render the page is being brought in, then a sudden burst of 100% (or whatever the OS can possibly allocate), and then back down to 10-20% which would be kee-alive mode.</p>
<p>The only reason I posted this was because I did write code once which exactly met these conditions, and put three testers and two developers on a wild goose chase finding out why we were getting such bad numbers and such good response times.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prashanth</title>
		<link>http://archisgore.com/2010/08/17/what-does-100-cpu-usage-mean/#comment-290</link>
		<dc:creator><![CDATA[Prashanth]]></dc:creator>
		<pubDate>Tue, 17 Aug 2010 05:56:07 +0000</pubDate>
		<guid isPermaLink="false">http://archisgore.com/?p=388#comment-290</guid>
		<description><![CDATA[I agree. Threading was never my forte. Python on the other hand has an excellent alternative to threading called the multiprocessing library (the reason partly is because python cannot execute 2 threads simultaneously on 2 cores owning to a &quot;global interpreter lock&quot;). The library has thread like semantics of shared data structures which are all explicitly marked as shared while the programmer is still aware that they are run as different processes. I really like this abstraction. Of course this is not optimal if you are doing a lot of sharing between the processes. 

Regarding your comment on caching - This is especially relevant in today&#039;s large web services where almost the whole system runs off of RAM. More than just latency - it is the variability in latency that kills disk. There is an excellent paper called RAMClouds by some stanford people if you are interested.]]></description>
		<content:encoded><![CDATA[<p>I agree. Threading was never my forte. Python on the other hand has an excellent alternative to threading called the multiprocessing library (the reason partly is because python cannot execute 2 threads simultaneously on 2 cores owning to a &#8220;global interpreter lock&#8221;). The library has thread like semantics of shared data structures which are all explicitly marked as shared while the programmer is still aware that they are run as different processes. I really like this abstraction. Of course this is not optimal if you are doing a lot of sharing between the processes. </p>
<p>Regarding your comment on caching &#8211; This is especially relevant in today&#8217;s large web services where almost the whole system runs off of RAM. More than just latency &#8211; it is the variability in latency that kills disk. There is an excellent paper called RAMClouds by some stanford people if you are interested.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shriphani Palakodety</title>
		<link>http://archisgore.com/2010/08/17/what-does-100-cpu-usage-mean/#comment-289</link>
		<dc:creator><![CDATA[Shriphani Palakodety]]></dc:creator>
		<pubDate>Tue, 17 Aug 2010 05:51:37 +0000</pubDate>
		<guid isPermaLink="false">http://archisgore.com/?p=388#comment-289</guid>
		<description><![CDATA[Ok this is from a n00b @ PHP. I thought that any process that requested I/O would get thrown into a wait queue pertaining to that device and it gets brought into a &quot;ready&quot; queue when the request is serviced. Why would PHP try its own busy-wait implementation when round-robin is available?]]></description>
		<content:encoded><![CDATA[<p>Ok this is from a n00b @ PHP. I thought that any process that requested I/O would get thrown into a wait queue pertaining to that device and it gets brought into a &#8220;ready&#8221; queue when the request is serviced. Why would PHP try its own busy-wait implementation when round-robin is available?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: archisgore</title>
		<link>http://archisgore.com/2010/08/17/what-does-100-cpu-usage-mean/#comment-288</link>
		<dc:creator><![CDATA[archisgore]]></dc:creator>
		<pubDate>Tue, 17 Aug 2010 05:46:27 +0000</pubDate>
		<guid isPermaLink="false">http://archisgore.com/?p=388#comment-288</guid>
		<description><![CDATA[Prashanth, your point is substantially valid, and that&#039;s exactly where the metrics are misinterpreted.

&quot;100% CPU usage over _what_ time?&quot; There are places where you&#039;re doing computations (coercing lists, rendering charts, computing results, etc.) where the data is available and in RAM (think building the facebook home feed from front-end caches every few seconds). All I&#039;m saying is, artificially making attempts in application code to reduce usage really go against the efforts the OS is making at optimizing. If the system really does need to do something, the OS wouldn&#039;t allocate a large slice to your CPU-intensive process anyway, and when it does allocate it, it means there was no better operation really waiting for it.

I/O wait state problems also really arise from just bad coding. Once more, I&#039;ve seen a lot of super-coders trying to do all sorts of Async calls without understanding the underlying mechanism and polling for responses. Counter-intuitively, if they depended on a blocking synchronous call, the OS could have taken care of the waiting efficiently, and timed out appropriately to provide responsiveness.

Actually the fact that nobody runs static pages is precisely why a 100% CPU state for short bursts is a good thing - your backend/IO responses are being cached to RAM until you have enough actionable data before waking up a thread for just one or two operations (unless they are conditional) before sleeping again, and your CPU is being utilized properly by other threads in the meantime.response and every thread proceeds a little bit (yes, a lot of webservers are configured with an unnecessary number of worker threads).]]></description>
		<content:encoded><![CDATA[<p>Prashanth, your point is substantially valid, and that&#8217;s exactly where the metrics are misinterpreted.</p>
<p>&#8220;100% CPU usage over _what_ time?&#8221; There are places where you&#8217;re doing computations (coercing lists, rendering charts, computing results, etc.) where the data is available and in RAM (think building the facebook home feed from front-end caches every few seconds). All I&#8217;m saying is, artificially making attempts in application code to reduce usage really go against the efforts the OS is making at optimizing. If the system really does need to do something, the OS wouldn&#8217;t allocate a large slice to your CPU-intensive process anyway, and when it does allocate it, it means there was no better operation really waiting for it.</p>
<p>I/O wait state problems also really arise from just bad coding. Once more, I&#8217;ve seen a lot of super-coders trying to do all sorts of Async calls without understanding the underlying mechanism and polling for responses. Counter-intuitively, if they depended on a blocking synchronous call, the OS could have taken care of the waiting efficiently, and timed out appropriately to provide responsiveness.</p>
<p>Actually the fact that nobody runs static pages is precisely why a 100% CPU state for short bursts is a good thing &#8211; your backend/IO responses are being cached to RAM until you have enough actionable data before waking up a thread for just one or two operations (unless they are conditional) before sleeping again, and your CPU is being utilized properly by other threads in the meantime.response and every thread proceeds a little bit (yes, a lot of webservers are configured with an unnecessary number of worker threads).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prashanth</title>
		<link>http://archisgore.com/2010/08/17/what-does-100-cpu-usage-mean/#comment-287</link>
		<dc:creator><![CDATA[Prashanth]]></dc:creator>
		<pubDate>Tue, 17 Aug 2010 01:21:19 +0000</pubDate>
		<guid isPermaLink="false">http://archisgore.com/?p=388#comment-287</guid>
		<description><![CDATA[As much as I would love to have my web server run at 100% usage, it usually more often than not means that there is a thread somewhere running on a busy wait. Most applications depend on some kind of I/O (who run static pages anymore?), which means that the CPU usage should drop when moving into an I/O wait state. My experience has been that the PHP module to both apache and lighttpd does a poor job at this.

Did I mention that the solution to this problem is to context switch more rapidly between the busy wait processes? :-)]]></description>
		<content:encoded><![CDATA[<p>As much as I would love to have my web server run at 100% usage, it usually more often than not means that there is a thread somewhere running on a busy wait. Most applications depend on some kind of I/O (who run static pages anymore?), which means that the CPU usage should drop when moving into an I/O wait state. My experience has been that the PHP module to both apache and lighttpd does a poor job at this.</p>
<p>Did I mention that the solution to this problem is to context switch more rapidly between the busy wait processes? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
