<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux and Virtualization &#187; CPU</title>
	<atom:link href="http://fclose.com/b/linux/tag/cpu/feed/" rel="self" type="application/rss+xml" />
	<link>http://fclose.com/b/linux</link>
	<description>Clear solutions, tutorials and tips on Linux and virtualization from the author&#039;s experience with clusters.</description>
	<lastBuildDate>Thu, 09 Feb 2012 14:49:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A Simple CPU and Memory Performance Test of Xen Dom0 and DomU</title>
		<link>http://fclose.com/b/linux/615/a-simple-cpu-and-memory-performance-test-of-xen-dom0-and-domu/</link>
		<comments>http://fclose.com/b/linux/615/a-simple-cpu-and-memory-performance-test-of-xen-dom0-and-domu/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 07:25:33 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[domu]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://zhiqiangma.info/a-simple-cpu-and-memory-performance-test-of-xen-dom0-and-domu/</guid>
		<description><![CDATA[Please refer to here for the platform of this test. I have done some simple performance test on DomU and Dom0 and compare with the performance on physical machines. These test are simple, but it can provides some performance factor of xen. I test the CPU bound, memory write and memory read performance of Dom0, [...]]]></description>
			<content:encoded><![CDATA[<p>Please refer to <a href="197/set-up-xen-341-dom0-on-top-of-fedora-11-with-kernel-2-6-29/">here</a> for the platform of this test.</p>
<p>I have done some simple performance test on DomU and Dom0 and compare with the performance on physical machines. These test are simple, but it can provides some performance factor of xen. I test the CPU bound, memory write and memory read performance of Dom0, DomU and compare them with the result of the test on physical machine. Each test are done for 50 times and the the Average (E), Standard deviation (SD) and SD/E are calculated.</p>
<p><strong>Test method:</strong></p>
<p>I only past the C code here because I think it is clear enough.</p>
<p>1) CPU bound:<br />
The code:</p>
<pre>  const int test_limit = 100000;
  cout &lt;&lt; "-----------------------------" &lt;&lt; endl;
  cout &lt;&lt; "cpu bound test begins." &lt;&lt; endl;
  clock_t begin_time = clock();
  register int a = 0;
  for (register int i = 0; i &lt; test_limit; i++) {
    for (register int j = 0; j &lt; test_limit; j++) {
      a += i + j;
    }
  }
  clock_t end_time = clock();
  do_nothing(a);
  int time = (end_time - begin_time) / (CLOCKS_PER_SEC / 1000);</pre>
<p>2) Memory read:</p>
<p>The code:</p>
<pre>  const int test_times = 1000000;
  const int data_size = 1000000000;
  const int data_interval = 1000000;
  int* array_read = new int[data_size];
  cout &lt;&lt; "----------------------" &lt;&lt; endl
       &lt;&lt; "Memory read bound test begins." &lt;&lt; endl;

  register int read_value = 0;
  long read_begin =0;
  long read_end = 0;
  int data_range = data_size - test_times;

  read_begin = clock();
  for (register int t = 0; t &lt; test_times; t++) {
    for (register int i = 0; i &lt; data_range; i += data_interval) {
      read_value = array_read[i + t];
    }
  }

  read_end = clock();
  do_nothing(read_value);
  int time = (read_end - read_begin) / (CLOCKS_PER_SEC / 1000);</pre>
<p>3) Memory write:</p>
<p>The code:</p>
<pre>  const int test_times = 1000000;
  const int data_size = 1000000000;
  const int data_interval = 1000000;

  int* array_write = new int[data_size];

  cout &lt;&lt; "----------------------" &lt;&lt; endl
       &lt;&lt; "Memory write bound test begins." &lt;&lt; endl;

  long write_begin = 0;
  long write_end = 0;
  int data_range = data_size - test_times;
  write_begin = clock();

  for (register int t = 0; t &lt; test_times; t++) {
    for (register int i = 0; i &lt; data_range; i += data_interval) {
      array_write[i + t] = 528283;
    }
  }

  write_end = clock();
  int time = (write_end - write_begin) / (CLOCKS_PER_SEC / 1000);</pre>
<p><strong>The result:</strong></p>
<p>Performance result on the physical machine:<br />
<!--        BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Liberation Sans"; font-size:x-small } --></p>
<table border="0" cellspacing="0" rules="none">
<col width="86"></col>
<col width="56"></col>
<col width="91"></col>
<col width="95"></col>
<tbody>
<tr>
<td style="border: 1px solid" width="86" height="16" align="center"><strong><span style="font-family: Liberation Serif"><br />
</span></strong></td>
<td style="border: 1px solid" colspan="3" width="242" align="center"><strong><span style="font-family: Liberation Serif">Physical machines test fedora kernel:</span></strong></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="right"><strong><span style="font-family: Liberation Serif"><br />
</span></strong></td>
<td style="border: 1px solid" align="right"><strong><span style="font-family: Liberation Serif">cpu</span></strong></td>
<td style="border: 1px solid" align="right"><strong><span style="font-family: Liberation Serif">memory read</span></strong></td>
<td style="border: 1px solid" align="right"><strong><span style="font-family: Liberation Serif">memory write</span></strong></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif">Average:</span></strong></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">13257.6</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">21449.6</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">22243.8</span></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif">Standard deviation:</span></strong></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">4.72</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">17.2</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">18.96</span></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif">SD/E:</span></strong></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">0</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">0</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">0</span></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif"><br />
</span></strong></td>
<td style="border: 1px solid" align="left"><span style="font-family: Liberation Serif"><br />
</span></td>
<td style="border: 1px solid" align="left"><span style="font-family: Liberation Serif"><br />
</span></td>
<td style="border: 1px solid" align="left"><span style="font-family: Liberation Serif"><br />
</span></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif">Perf/Perf on Phy:</span></strong></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">100.00%</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">100.00%</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">100.00%</span></td>
</tr>
</tbody>
</table>
<p>Performance result on Dom0:<br />
<!--        BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Liberation Sans"; font-size:x-small } --></p>
<table border="0" cellspacing="0" rules="none">
<col width="86"></col>
<col width="56"></col>
<col width="91"></col>
<col width="95"></col>
<tbody>
<tr>
<td style="border: 1px solid" width="86" height="16" align="left"><span style="font-family: Liberation Serif"><br />
</span></td>
<td style="border: 1px solid" colspan="3" width="242" align="center"><strong><span style="font-family: Liberation Serif">Dom0 suse kernel test</span></strong></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><span style="font-family: Liberation Serif"><br />
</span></td>
<td style="border: 1px solid" align="right"><strong><span style="font-family: Liberation Serif">cpu</span></strong></td>
<td style="border: 1px solid" align="right"><strong><span style="font-family: Liberation Serif">memory read</span></strong></td>
<td style="border: 1px solid" align="right"><strong><span style="font-family: Liberation Serif">memory write</span></strong></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif">Average:</span></strong></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">13283</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">23059</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">23856.6</span></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif">Standard deviation:</span></strong></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">4.58</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">22.38</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">18.07</span></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif">SD/E:</span></strong></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">0</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">0</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif">0</span></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif"><br />
</span></strong></td>
<td style="border: 1px solid" align="left"><span style="font-family: Liberation Serif"><br />
</span></td>
<td style="border: 1px solid" align="left"><span style="font-family: Liberation Serif"><br />
</span></td>
<td style="border: 1px solid" align="left"><span style="font-family: Liberation Serif"><br />
</span></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif">Perf/Perf on Phy:</span></strong></td>
<td style="border: 1px solid" align="right"><span style="color: #ff0000"><span style="font-family: Liberation Serif">99.81%</span></span></td>
<td style="border: 1px solid" align="right"><span style="color: #ff0000"><span style="font-family: Liberation Serif">93.02%</span></span></td>
<td style="border: 1px solid" align="right"><span style="color: #ff0000"><span style="font-family: Liberation Serif">93.24%</span></span></td>
</tr>
</tbody>
</table>
<p>Performance result on DomU:<br />
<!--        BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Liberation Sans"; font-size:x-small } --></p>
<table border="0" cellspacing="0" rules="none">
<col width="86"></col>
<col width="56"></col>
<col width="91"></col>
<col width="95"></col>
<tbody>
<tr>
<td style="border: 1px solid" width="86" height="16" align="left"><span style="font-family: Liberation Serif"><br />
</span></td>
<td style="border: 1px solid" colspan="3" width="242" align="center"><strong><span style="font-family: Liberation Serif">DomU fedora kernel test</span></strong></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><span style="font-family: Liberation Serif"><br />
</span></td>
<td style="border: 1px solid" align="right"><strong><span style="font-family: Liberation Serif">cpu</span></strong></td>
<td style="border: 1px solid" align="right"><strong><span style="font-family: Liberation Serif">memory read</span></strong></td>
<td style="border: 1px solid" align="right"><strong><span style="font-family: Liberation Serif">memory write</span></strong></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif">Average:</span></strong></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif,Times New Roman">13307.6</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif,Times New Roman">23667.8</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif,Times New Roman">24459.2</span></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif">Standard deviation:</span></strong></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif,Times New Roman">13.2</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif,Times New Roman">33.96</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif,Times New Roman">37.19</span></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif">SD/E:</span></strong></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif,Times New Roman">0</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif,Times New Roman">0</span></td>
<td style="border: 1px solid" align="right"><span style="font-family: Liberation Serif,Times New Roman">0</span></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif"><br />
</span></strong></td>
<td style="border: 1px solid" align="left"><span style="font-family: Liberation Serif"><br />
</span></td>
<td style="border: 1px solid" align="left"><span style="font-family: Liberation Serif"><br />
</span></td>
<td style="border: 1px solid" align="left"><span style="font-family: Liberation Serif"><br />
</span></td>
</tr>
<tr>
<td style="border: 1px solid" height="16" align="left"><strong><span style="font-family: Liberation Serif">Perf/Perf on Phy:</span></strong></td>
<td style="border: 1px solid" align="right"><span style="color: #ff0000"><span style="font-family: Liberation Serif">99.62%</span></span></td>
<td style="border: 1px solid" align="right"><span style="color: #ff0000"><span style="font-family: Liberation Serif">90.63%</span></span></td>
<td style="border: 1px solid" align="right"><span style="color: #ff0000"><span style="font-family: Liberation Serif">90.94%</span></span></td>
</tr>
</tbody>
</table>
<p>From the test, we can see that the CPU performance is nearly 100%. But the memory performance is not so good especially for the DomU. This maybe because of the memory validation of Xen. But the CPU and memory performance of Xen VM is pretty good as a virtual machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/615/a-simple-cpu-and-memory-performance-test-of-xen-dom0-and-domu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

