<?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>Erlang非业余研究 &#187; cpu</title>
	<atom:link href="http://blog.yufeng.info/archives/tag/cpu/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.yufeng.info</link>
	<description>Erlang系统深度探索和应用</description>
	<lastBuildDate>Tue, 17 Jan 2012 06:05:54 +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>ECUG2010分享：C1000K高性能服务器构架技术</title>
		<link>http://blog.yufeng.info/archives/776</link>
		<comments>http://blog.yufeng.info/archives/776#comments</comments>
		<pubDate>Mon, 18 Oct 2010 08:37:41 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[Erlang探索]]></category>
		<category><![CDATA[bonding]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[Erts]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[numa]]></category>
		<category><![CDATA[os]]></category>

		<guid isPermaLink="false">http://blog.yufeng.info/?p=776</guid>
		<description><![CDATA[原创文章，转载请注明： 转载自Erlang非业余研究 本文链接地址: ECUG2010分享：C1000K高性能服务器构架技术 C1000K高性能服务器构建技术 View more presentations from Feng Yu. 点击这里下载 ppt 视频这里 照片这里 这次ECUG2010的讲师来自不同的国家，有点国际化的味道，也说明了这个世界越来越扁平，技术越越来越同步，我们追随技术的压力也越来越大。 Post Footer automatically generated by wp-posturl plugin for wordpress.]]></description>
			<content:encoded><![CDATA[<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.yufeng.info/">Erlang非业余研究</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.yufeng.info/archives/776">ECUG2010分享：C1000K高性能服务器构架技术</a></p>
</div>
<div style="width:425px" id="__ss_5449105"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/mryufeng/c1000k" title="C1000K高性能服务器构建技术">C1000K高性能服务器构建技术</a></strong><object id="__sse5449105" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=c1000k-12871244425597-phpapp01&#038;stripped_title=c1000k&#038;userName=mryufeng" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse5449105" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=c1000k-12871244425597-phpapp01&#038;stripped_title=c1000k&#038;userName=mryufeng" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/mryufeng">Feng Yu</a>.</div>
</div>
<p><span id="more-776"></span><br />
点击<a href="http://blog.yufeng.info/C1000K.ppt">这里</a>下载 ppt<br />
<a href="http://v.ku6.com/special/show_3859073/k1k1Zhmm_ZfpxEYn.html">视频这里</a><br />
<a href="http://xushiwei.com/ecug-con-2010-photo">照片这里</a></p>
<p>这次ECUG2010的讲师来自不同的国家，有点国际化的味道，也说明了这个世界越来越扁平，技术越越来越同步，我们追随技术的压力也越来越大。</p>
<div style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">
<p>Post Footer automatically generated by <a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl plugin</a> for wordpress.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/776/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CPU拓扑结构的调查</title>
		<link>http://blog.yufeng.info/archives/666</link>
		<comments>http://blog.yufeng.info/archives/666#comments</comments>
		<pubDate>Sat, 25 Sep 2010 05:32:01 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[工具介绍]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[topology]]></category>

		<guid isPermaLink="false">http://blog.yufeng.info/?p=666</guid>
		<description><![CDATA[原创文章，转载请注明： 转载自Erlang非业余研究 本文链接地址: CPU拓扑结构的调查 在做多核程序的时候(比如Erlang程序)，我们需要了解cpu的拓扑结构, 了解logic CPU和物理的CPU的映射关系，以及了解CPU的内部的硬件参数，比如说 L1，L2 cache的大小等信息。 Linux下的/proc/cpuinfo提供了相应的信息，但是比较不全面。 /sys/devices/system/cpu/也提供了topology结构但是比较难解读。 很多时候我们需要更专业的工具了。intel提供了这样的救助。参见： http://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration/ 下载下来编译执行就好。 [admin@my174 cpu-topology]$ ./cpu_topology64.out Advisory to Users on system topology enumeration This utility is for demonstration purpose only. It assumes the hardware topology configuration within a coherent domain does not change during the life of an OS session. If an OS support [...]]]></description>
			<content:encoded><![CDATA[<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.yufeng.info/">Erlang非业余研究</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.yufeng.info/archives/666">CPU拓扑结构的调查</a></p>
</div>
<p>在做多核程序的时候(比如Erlang程序)，我们需要了解cpu的拓扑结构, 了解logic CPU和物理的CPU的映射关系，以及了解CPU的内部的硬件参数，比如说<br />
L1，L2 cache的大小等信息。</p>
<p>Linux下的/proc/cpuinfo提供了相应的信息，但是比较不全面。  /sys/devices/system/cpu/也提供了topology结构但是比较难解读。</p>
<p>很多时候我们需要更专业的工具了。intel提供了这样的救助。参见： <a href="http://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration/">http://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration/</a></p>
<p>下载下来编译执行就好。</p>
<p>[admin@my174 cpu-topology]$ ./cpu_topology64.out<br />
<span id="more-666"></span><br />
        Advisory to Users on system topology enumeration</p>
<p>This utility is for demonstration purpose only. It assumes the hardware topology<br />
configuration within a coherent domain does not change during the life of an OS<br />
session. If an OS support advanced features that can change hardware topology<br />
configurations, more sophisticated adaptation may be necessary to account for<br />
the hardware configuration change that might have added and reduced the number<br />
of logical processors being managed by the OS.</p>
<p>User should also`be aware that the system topology enumeration algorithm is<br />
based on the assumption that CPUID instruction will return raw data reflecting<br />
the native hardware configuration. When an application runs inside a virtual<br />
machine hosted by a Virtual Machine Monitor (VMM), any CPUID instructions<br />
issued by an app (or a guest OS) are trapped by the VMM and it is the VMM&#8217;s<br />
responsibility and decision to emulate/supply CPUID return data to the virtual<br />
machines. When deploying topology enumeration code based on querying CPUID<br />
inside a VM environment, the user must consult with the VMM vendor on how an VMM<br />
will emulate CPUID instruction relating to topology enumeration.</p>
<p>        Software visible enumeration in the system:<br />
Number of logical processors visible to the OS: 16<br />
Number of logical processors visible to this process: 16<br />
Number of processor cores visible to this process: 8<br />
Number of physical packages visible to this process: 2 </p>
<p>        Hierarchical counts by levels of processor topology:<br />
 # of cores in package  0 visible to this process: 4 .<br />
         # of logical processors in Core 0 visible to this process: 2 .<br />
         # of logical processors in Core  1 visible to this process: 2 .<br />
         # of logical processors in Core  2 visible to this process: 2 .<br />
         # of logical processors in Core  3 visible to this process: 2 .<br />
 # of cores in package  1 visible to this process: 4 .<br />
         # of logical processors in Core 0 visible to this process: 2 .<br />
         # of logical processors in Core  1 visible to this process: 2 .<br />
         # of logical processors in Core  2 visible to this process: 2 .<br />
         # of logical processors in Core  3 visible to this process: 2 .</p>
<p>        Affinity masks per SMT thread, per core, per package:<br />
Individual:<br />
        P:0, C:0, T:0 &#8211;> 1<br />
        P:0, C:0, T:1 &#8211;> 100</p>
<p>Core-aggregated:<br />
        P:0, C:0 &#8211;> 101<br />
Individual:<br />
        P:0, C:1, T:0 &#8211;> 4<br />
        P:0, C:1, T:1 &#8211;> 400</p>
<p>Core-aggregated:<br />
        P:0, C:1 &#8211;> 404<br />
Individual:<br />
        P:0, C:2, T:0 &#8211;> 10<br />
        P:0, C:2, T:1 &#8211;> 1z3</p>
<p>Core-aggregated:<br />
        P:0, C:2 &#8211;> 1010<br />
Individual:<br />
        P:0, C:3, T:0 &#8211;> 40<br />
        P:0, C:3, T:1 &#8211;> 4z3</p>
<p>Core-aggregated:<br />
        P:0, C:3 &#8211;> 4040</p>
<p>Pkg-aggregated:<br />
        P:0 &#8211;> 5555<br />
Individual:<br />
        P:1, C:0, T:0 &#8211;> 2<br />
        P:1, C:0, T:1 &#8211;> 200</p>
<p>Core-aggregated:<br />
        P:1, C:0 &#8211;> 202<br />
Individual:<br />
        P:1, C:1, T:0 &#8211;> 8<br />
        P:1, C:1, T:1 &#8211;> 800</p>
<p>Core-aggregated:<br />
        P:1, C:1 &#8211;> 808<br />
Individual:<br />
        P:1, C:2, T:0 &#8211;> 20<br />
        P:1, C:2, T:1 &#8211;> 2z3</p>
<p>Core-aggregated:<br />
        P:1, C:2 &#8211;> 2020<br />
Individual:<br />
        P:1, C:3, T:0 &#8211;> 80<br />
        P:1, C:3, T:1 &#8211;> 8z3</p>
<p>Core-aggregated:<br />
        P:1, C:3 &#8211;> 8080</p>
<p>Pkg-aggregated:<br />
        P:1 &#8211;> aaaa</p>
<p>        APIC ID listings from affinity masks<br />
OS cpu   0, Affinity mask   000001 &#8211; apic id 10<br />
OS cpu   1, Affinity mask   000002 &#8211; apic id 0<br />
OS cpu   2, Affinity mask   000004 &#8211; apic id 12<br />
OS cpu   3, Affinity mask   000008 &#8211; apic id 2<br />
OS cpu   4, Affinity mask   000010 &#8211; apic id 14<br />
OS cpu   5, Affinity mask   000020 &#8211; apic id 4<br />
OS cpu   6, Affinity mask   000040 &#8211; apic id 16<br />
OS cpu   7, Affinity mask   000080 &#8211; apic id 6<br />
OS cpu   8, Affinity mask   000100 &#8211; apic id 11<br />
OS cpu   9, Affinity mask   000200 &#8211; apic id 1<br />
OS cpu  10, Affinity mask   000400 &#8211; apic id 13<br />
OS cpu  11, Affinity mask   000800 &#8211; apic id 3<br />
OS cpu  12, Affinity mask   001000 &#8211; apic id 15<br />
OS cpu  13, Affinity mask   002000 &#8211; apic id 5<br />
OS cpu  14, Affinity mask   004000 &#8211; apic id 17<br />
OS cpu  15, Affinity mask   008000 &#8211; apic id 7</p>
<p>Package 0 Cache and Thread details</p>
<p>Box Description:<br />
Cache  is cache level designator<br />
Size   is cache size<br />
OScpu# is cpu # as seen by OS<br />
Core   is core#[_thread# if > 1 thread/core] inside socket<br />
AffMsk is AffinityMask(extended hex) for core and thread<br />
CmbMsk is Combined AffinityMask(extended hex) for hw threads sharing cache<br />
       CmbMsk will differ from AffMsk if > 1 hw_thread/cache<br />
Extended Hex replaces trailing zeroes with &#8216;z#&#8217;<br />
       where # is number of zeroes (so &#8217;8z5&#8242; is &#8217;0&#215;800000&#8242;)<br />
L1D is Level 1 Data cache, size(KBytes)= 32,  Cores/cache= 2, Caches/package= 4<br />
L1I is Level 1 Instruction cache, size(KBytes)= 32,  Cores/cache= 2, Caches/package= 4<br />
L2 is Level 2 Unified cache, size(KBytes)= 256,  Cores/cache= 2, Caches/package= 4<br />
L3 is Level 3 Unified cache, size(KBytes)= 8192,  Cores/cache= 8, Caches/package= 1<br />
      +&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+<br />
Cache |  L1D      |  L1D      |  L1D      |  L1D      |<br />
Size  |  32K      |  32K      |  32K      |  32K      |<br />
OScpu#|    0     8|    2    10|    4    12|    6    14|<br />
Core  |c0_t0 c0_t1|c1_t0 c1_t1|c2_t0 c2_t1|c3_t0 c3_t1|<br />
AffMsk|    1   100|    4   400|   10   1z3|   40   4z3|<br />
CmbMsk|  101      |  404      | 1010      | 4040      |<br />
      +&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+</p>
<p>Cache |  L1I      |  L1I      |  L1I      |  L1I      |<br />
Size  |  32K      |  32K      |  32K      |  32K      |<br />
      +&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+</p>
<p>Cache |   L2      |   L2      |   L2      |   L2      |<br />
Size  | 256K      | 256K      | 256K      | 256K      |<br />
      +&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+</p>
<p>Cache |   L3                                          |<br />
Size  |   8M                                          |<br />
CmbMsk| 5555                                          |<br />
      +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+</p>
<p>Combined socket AffinityMask= 0&#215;5555</p>
<p>Package 1 Cache and Thread details</p>
<p>Box Description:<br />
Cache  is cache level designator<br />
Size   is cache size<br />
OScpu# is cpu # as seen by OS<br />
Core   is core#[_thread# if > 1 thread/core] inside socket<br />
AffMsk is AffinityMask(extended hex) for core and thread<br />
CmbMsk is Combined AffinityMask(extended hex) for hw threads sharing cache<br />
       CmbMsk will differ from AffMsk if > 1 hw_thread/cache<br />
Extended Hex replaces trailing zeroes with &#8216;z#&#8217;<br />
       where # is number of zeroes (so &#8217;8z5&#8242; is &#8217;0&#215;800000&#8242;)<br />
      +&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+<br />
Cache |  L1D      |  L1D      |  L1D      |  L1D      |<br />
Size  |  32K      |  32K      |  32K      |  32K      |<br />
OScpu#|    1     9|    3    11|    5    13|    7    15|<br />
Core  |c0_t0 c0_t1|c1_t0 c1_t1|c2_t0 c2_t1|c3_t0 c3_t1|<br />
AffMsk|    2   200|    8   800|   20   2z3|   80   8z3|<br />
CmbMsk|  202      |  808      | 2020      | 8080      |<br />
      +&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+</p>
<p>Cache |  L1I      |  L1I      |  L1I      |  L1I      |<br />
Size  |  32K      |  32K      |  32K      |  32K      |<br />
      +&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+</p>
<p>Cache |   L2      |   L2      |   L2      |   L2      |<br />
Size  | 256K      | 256K      | 256K      | 256K      |<br />
      +&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+</p>
<p>Cache |   L3                                          |<br />
Size  |   8M                                          |<br />
CmbMsk| aaaa                                          |<br />
      +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+</p>
<p>我们可以很清楚的看到我们CPU的信息，L1,L2,L3, cacheline的大小等，这些信息我们在做程序的时候经常需要的。<br />
玩的开心！</p>
<p>参考文献：</p>
<p>1 . <a href="https://kevinclosson.wordpress.com/2009/04/22/linux-thinks-its-a-cpu-but-what-is-it-really-mapping-xeon-5500-nehalem-processor-threads-to-linux-os-cpus/">https://kevinclosson.wordpress.com/2009/04/22/linux-thinks-its-a-cpu-but-what-is-it-really-mapping-xeon-5500-nehalem-processor-threads-to-linux-os-cpus/</a></p>
<p>2. <a href=" http://www.kernel.org/doc/Documentation/ABI/testing/sysfs-devices-system-cpu"> http://www.kernel.org/doc/Documentation/ABI/testing/sysfs-devices-system-cpu</a></p>
<p>3. <a href="http://chemnitzer.linux-tage.de/2010/vortraege/shortpaper/470-slides.pdf ">http://chemnitzer.linux-tage.de/2010/vortraege/shortpaper/470-slides.pdf </a></p>
<p>4.  <a href="http://software.intel.com/sites/oss/pdfs/mclinux.pdf">http://software.intel.com/sites/oss/pdfs/mclinux.pdf</a></p>
<div style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">
<p>Post Footer automatically generated by <a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl plugin</a> for wordpress.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/666/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>sysbench(系统性能基准)介绍</title>
		<link>http://blog.yufeng.info/archives/614</link>
		<comments>http://blog.yufeng.info/archives/614#comments</comments>
		<pubDate>Tue, 27 Jul 2010 09:09:03 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[工具介绍]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[fileio]]></category>
		<category><![CDATA[mutex]]></category>
		<category><![CDATA[oltp]]></category>
		<category><![CDATA[sysbench]]></category>

		<guid isPermaLink="false">http://blog.yufeng.info/?p=614</guid>
		<description><![CDATA[原创文章，转载请注明： 转载自Erlang非业余研究 本文链接地址: sysbench(系统性能基准)介绍 SysBench is a modular, cross-platform and multi-threaded benchmark tool for evaluating OS parameters that are important for a system running a database under intensive load. Current features allow to test the following system parameters: * cpu性能 * file I/O performance * scheduler performance * mutex的性能 * memory allocation and transfer speed, [...]]]></description>
			<content:encoded><![CDATA[<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.yufeng.info/">Erlang非业余研究</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.yufeng.info/archives/614">sysbench(系统性能基准)介绍</a></p>
</div>
<p>SysBench is a modular, cross-platform and multi-threaded benchmark tool for evaluating OS parameters that are important for a system running a database under intensive load.<br />
Current features allow to test the following system parameters:<br />
    * cpu性能<br />
    * file I/O performance<br />
    * scheduler performance<br />
    * mutex的性能<br />
    * memory allocation and transfer speed, 支持hugepage<br />
    * POSIX threads implementation performance<br />
    * database server performance (OLTP benchmark) 支持mysql，pgsql, oracle</p>
<p>项目地址是：<a href="http://sysbench.sourceforge.net/">http://sysbench.sourceforge.net/</a></p>
<p>从源码来看这个项目做的非常的模块化。 sysbench提供了诸如读取配置， 创建线程， 日志， 计时和模块化框架，支持的测试模式都是通过插件方式加入到框架去的。 </p>
<p>用户很容易扩展相应的模块， 通常模块只需要关注自己要实现的测试功能，其他的事情由框架来做，很大的方便用户自己编写特定的测试模块。其他的如多线程什么的都无需自己去考虑。</p>
<p>在数据库的驱动方面，目前提供了mysql，pgsql, oracle的驱动。在数据库抽象方面也是模块的，用户自己也能容易加入自己的数据库支持。</p>
<p>作为一个轻量级别的bench工具，在系统的系统测量方面，可以了解到对系统运行产生很大影响的性能，如内存，cpu，磁盘，锁，线程调度，数据库等方面的信息，是一个得心应手的工具。</p>
<p>在ubuntu下可以用apt-get install sysbench来安装，具体的使用参看 man sysbench。</p>
<p>玩的开心！</p>
<div style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">
<p>Post Footer automatically generated by <a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl plugin</a> for wordpress.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/614/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

