- 浏览: 982396 次
- 性别:
- 来自: 广州
最新评论
-
qingchuwudi:
有用,非常感谢!
erlang进程的优先级 -
zfjdiamond:
你好 这条命令 在那里输入??
你们有yum 我有LuaRocks -
simsunny22:
这个是在linux下运行的吧,在window下怎么运行escr ...
escript的高级特性 -
mozhenghua:
http://www.erlang.org/doc/apps/ ...
mnesia 分布协调的几个细节 -
fxltsbl:
A new record of 108000 HTTP req ...
Haproxy 1.4-dev2: barrier of 100k HTTP req/s crossed
原文地址: http://www.erlangatwork.com/2009/03/lies-damned-lies-and-benchmarks.html
Erlang/OTP R13A was released today with a number of major SMP improvements. I've been playing with R13 snapshots for a while and wrote a simple HTTP server to compare the SMP performance on R12 and R13. This server uses {packet, http} to decode requests, increments a counter with a transactional mnesia:read/3 and mnesia:write/1, and responds with the counter's previous value. You'll find the source here.
I ran the HTTP server on a x86_64 CentOS 5 machine running Linux 2.6.18-53.el5. The server has two quad-Core Intel Xeon E5450 CPUs and 8GB of RAM. Erlang/OTP R12B-5 and R13A were compiled from source and run as erl -pa ebin +SN -s ehttpd start where N indicated the number of schedulers to run.
To get performance numbers I ran ab on another server connected via a 100 Mb/s private VLAN as ab -c N -n 100000 http://10.0.0.32:8889/ where N was the number of concurrent requests. ab was run 3 times for each value of N and the following chart shows the average requests/sec with 4 and 8 schedulers.
[img]schedulers.png [/img]
R13A's SMP improvements include multiple run queues and improved locking. It also supports binding schedulers to specific CPU cores and hardware threads. Binding isn't enabled by default, so the following chart shows the result of setting erlang:system_flag(scheduler_bind_type, thread_no_node_processor_spread) and running with 100 concurrent requests.
[img]requests_sec.png [/img]
There is a lot missing from these benchmarks, I didn't test kernel polling and only generated load from one client machine. The drop between 500 and 1000 concurrent requests on R13A +S8 looks too steep and may be the result of using ab. That said, the SMP optimizations in R13 are looking very promising!
根据我在ecug上做的实验:8核心的cpu
[spawn(ring, run,[["100", "10000000000"]]) || _X <- lists:seq(1,1000)].
R12B5:
CPU User% Sys% Wait% Idle|0 |25 |50 |75 100| 3
3 1 21.3 62.4 0.0 16.3|UUUUUUUUUUsssssssssssssssssssssssssssssss >| 3
3 2 20.9 61.7 0.0 17.4|UUUUUUUUUUssssssssssssssssssssssssssssss > | 3
3 3 19.9 63.2 0.0 16.9|UUUUUUUUUsssssssssssssssssssssssssssssss > 3
3 4 18.9 64.2 0.0 16.9|UUUUUUUUUssssssssssssssssssssssssssssssss > 3
3 5 19.9 62.7 0.0 17.4|UUUUUUUUUsssssssssssssssssssssssssssssss > 3
3 6 20.9 63.2 0.0 15.9|UUUUUUUUUUsssssssssssssssssssssssssssssss > 3
3 7 19.4 62.7 0.0 17.9|UUUUUUUUUsssssssssssssssssssssssssssssss > | 3
3 8 19.4 63.7 0.0 16.9
R13A:
CPU User% Sys% Wait% Idle|0 |25 |50 |75 100| 3
3 1 61.2 31.8 0.0 7.0|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUsssssssssssssss > | 3
3 2 64.7 29.9 0.0 5.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss > | 3
3 3 62.7 29.9 0.0 7.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss > | 3
3 4 61.0 32.5 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssssss > | 3
3 5 62.5 30.5 0.0 7.0|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUsssssssssssssss > | 3
3 6 64.2 29.4 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss >| 3
3 7 63.7 29.9 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss > | 3
3 8 65.7 27.9 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUsssssssssssss > | 3
3 +-------------------------------------------------+ 3
3Avg 63.2 30.2 0.0 6.5
sys的调用主要是futex 所有对锁的依赖大量减少!
结论: 速度提高了将近2倍 效果真的很好yeah!
Erlang/OTP R13A was released today with a number of major SMP improvements. I've been playing with R13 snapshots for a while and wrote a simple HTTP server to compare the SMP performance on R12 and R13. This server uses {packet, http} to decode requests, increments a counter with a transactional mnesia:read/3 and mnesia:write/1, and responds with the counter's previous value. You'll find the source here.
I ran the HTTP server on a x86_64 CentOS 5 machine running Linux 2.6.18-53.el5. The server has two quad-Core Intel Xeon E5450 CPUs and 8GB of RAM. Erlang/OTP R12B-5 and R13A were compiled from source and run as erl -pa ebin +SN -s ehttpd start where N indicated the number of schedulers to run.
To get performance numbers I ran ab on another server connected via a 100 Mb/s private VLAN as ab -c N -n 100000 http://10.0.0.32:8889/ where N was the number of concurrent requests. ab was run 3 times for each value of N and the following chart shows the average requests/sec with 4 and 8 schedulers.
[img]schedulers.png [/img]
R13A's SMP improvements include multiple run queues and improved locking. It also supports binding schedulers to specific CPU cores and hardware threads. Binding isn't enabled by default, so the following chart shows the result of setting erlang:system_flag(scheduler_bind_type, thread_no_node_processor_spread) and running with 100 concurrent requests.
[img]requests_sec.png [/img]
There is a lot missing from these benchmarks, I didn't test kernel polling and only generated load from one client machine. The drop between 500 and 1000 concurrent requests on R13A +S8 looks too steep and may be the result of using ab. That said, the SMP optimizations in R13 are looking very promising!
根据我在ecug上做的实验:8核心的cpu
[spawn(ring, run,[["100", "10000000000"]]) || _X <- lists:seq(1,1000)].
R12B5:
CPU User% Sys% Wait% Idle|0 |25 |50 |75 100| 3
3 1 21.3 62.4 0.0 16.3|UUUUUUUUUUsssssssssssssssssssssssssssssss >| 3
3 2 20.9 61.7 0.0 17.4|UUUUUUUUUUssssssssssssssssssssssssssssss > | 3
3 3 19.9 63.2 0.0 16.9|UUUUUUUUUsssssssssssssssssssssssssssssss > 3
3 4 18.9 64.2 0.0 16.9|UUUUUUUUUssssssssssssssssssssssssssssssss > 3
3 5 19.9 62.7 0.0 17.4|UUUUUUUUUsssssssssssssssssssssssssssssss > 3
3 6 20.9 63.2 0.0 15.9|UUUUUUUUUUsssssssssssssssssssssssssssssss > 3
3 7 19.4 62.7 0.0 17.9|UUUUUUUUUsssssssssssssssssssssssssssssss > | 3
3 8 19.4 63.7 0.0 16.9
R13A:
CPU User% Sys% Wait% Idle|0 |25 |50 |75 100| 3
3 1 61.2 31.8 0.0 7.0|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUsssssssssssssss > | 3
3 2 64.7 29.9 0.0 5.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss > | 3
3 3 62.7 29.9 0.0 7.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss > | 3
3 4 61.0 32.5 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssssss > | 3
3 5 62.5 30.5 0.0 7.0|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUsssssssssssssss > | 3
3 6 64.2 29.4 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss >| 3
3 7 63.7 29.9 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss > | 3
3 8 65.7 27.9 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUsssssssssssss > | 3
3 +-------------------------------------------------+ 3
3Avg 63.2 30.2 0.0 6.5
sys的调用主要是futex 所有对锁的依赖大量减少!
结论: 速度提高了将近2倍 效果真的很好yeah!
评论
5 楼
mryufeng
2009-03-19
我strace了 基本上是futex 也就是说大量的锁争夺不见了 因为这个测试是ring, 基本上是消息发送和接受! 这个效果可以说非常好!
4 楼
Arbow
2009-03-19
哇,内核占用的cpu少了不少啊
3 楼
mryufeng
2009-03-19
根据我在ecug上做的实验:8核心的cpu
[spawn(ring, run,[["100", "10000000000"]]) || _X <- lists:seq(1,1000)].
R12B5:
CPU User% Sys% Wait% Idle|0 |25 |50 |75 100| 3
3 1 21.3 62.4 0.0 16.3|UUUUUUUUUUsssssssssssssssssssssssssssssss >| 3
3 2 20.9 61.7 0.0 17.4|UUUUUUUUUUssssssssssssssssssssssssssssss > | 3
3 3 19.9 63.2 0.0 16.9|UUUUUUUUUsssssssssssssssssssssssssssssss > 3
3 4 18.9 64.2 0.0 16.9|UUUUUUUUUssssssssssssssssssssssssssssssss > 3
3 5 19.9 62.7 0.0 17.4|UUUUUUUUUsssssssssssssssssssssssssssssss > 3
3 6 20.9 63.2 0.0 15.9|UUUUUUUUUUsssssssssssssssssssssssssssssss > 3
3 7 19.4 62.7 0.0 17.9|UUUUUUUUUsssssssssssssssssssssssssssssss > | 3
3 8 19.4 63.7 0.0 16.9
R13A:
CPU User% Sys% Wait% Idle|0 |25 |50 |75 100| 3
3 1 61.2 31.8 0.0 7.0|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUsssssssssssssss > | 3
3 2 64.7 29.9 0.0 5.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss > | 3
3 3 62.7 29.9 0.0 7.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss > | 3
3 4 61.0 32.5 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssssss > | 3
3 5 62.5 30.5 0.0 7.0|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUsssssssssssssss > | 3
3 6 64.2 29.4 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss >| 3
3 7 63.7 29.9 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss > | 3
3 8 65.7 27.9 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUsssssssssssss > | 3
3 +-------------------------------------------------+ 3
3Avg 63.2 30.2 0.0 6.5
sys的调用主要是futex 所有对锁的依赖大量减少!
速度提高了将近2倍 效果真的很好yeah!
[spawn(ring, run,[["100", "10000000000"]]) || _X <- lists:seq(1,1000)].
R12B5:
CPU User% Sys% Wait% Idle|0 |25 |50 |75 100| 3
3 1 21.3 62.4 0.0 16.3|UUUUUUUUUUsssssssssssssssssssssssssssssss >| 3
3 2 20.9 61.7 0.0 17.4|UUUUUUUUUUssssssssssssssssssssssssssssss > | 3
3 3 19.9 63.2 0.0 16.9|UUUUUUUUUsssssssssssssssssssssssssssssss > 3
3 4 18.9 64.2 0.0 16.9|UUUUUUUUUssssssssssssssssssssssssssssssss > 3
3 5 19.9 62.7 0.0 17.4|UUUUUUUUUsssssssssssssssssssssssssssssss > 3
3 6 20.9 63.2 0.0 15.9|UUUUUUUUUUsssssssssssssssssssssssssssssss > 3
3 7 19.4 62.7 0.0 17.9|UUUUUUUUUsssssssssssssssssssssssssssssss > | 3
3 8 19.4 63.7 0.0 16.9
R13A:
CPU User% Sys% Wait% Idle|0 |25 |50 |75 100| 3
3 1 61.2 31.8 0.0 7.0|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUsssssssssssssss > | 3
3 2 64.7 29.9 0.0 5.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss > | 3
3 3 62.7 29.9 0.0 7.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss > | 3
3 4 61.0 32.5 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssssss > | 3
3 5 62.5 30.5 0.0 7.0|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUsssssssssssssss > | 3
3 6 64.2 29.4 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss >| 3
3 7 63.7 29.9 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUssssssssssssss > | 3
3 8 65.7 27.9 0.0 6.5|UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUsssssssssssss > | 3
3 +-------------------------------------------------+ 3
3Avg 63.2 30.2 0.0 6.5
sys的调用主要是futex 所有对锁的依赖大量减少!
速度提高了将近2倍 效果真的很好yeah!
2 楼
mryufeng
2009-03-19
性能提升确实很多哦 这次单单smp就添加了几千行代码!
1 楼
dogstar
2009-03-19
早知道就直接看最后一个单词了 promising
:)
:)
发表评论
-
OTP R14A今天发布了
2010-06-17 14:36 2677以下是这次发布的亮点,没有太大的性能改进, 主要是修理了很多B ... -
R14A实现了EEP31,添加了binary模块
2010-05-21 15:15 3030Erlang的binary数据结构非常强大,而且偏向底层,在作 ... -
如何查看节点的可用句柄数目和已用句柄数
2010-04-08 03:31 4814很多同学在使用erlang的过程中, 碰到了很奇怪的问题, 后 ... -
获取Erlang系统信息的代码片段
2010-04-06 21:49 3475从lib/megaco/src/tcp/megaco_tcp_ ... -
iolist跟list有什么区别?
2010-04-06 20:30 6529看到erlang-china.org上有个 ... -
erlang:send_after和erlang:start_timer的使用解释
2010-04-06 18:31 8386前段时间arksea 同学提出这个问题, 因为文档里面写的很不 ... -
Latest news from the Erlang/OTP team at Ericsson 2010
2010-04-05 19:23 2013参考Talk http://www.erlang-factor ... -
对try 异常 运行的疑问,为什么出现两种结果
2010-04-05 19:22 2842郎咸武<langxianzhe@163.com> ... -
Erlang ERTS Async基础设施
2010-03-19 00:03 2517其实Erts的Async做的很不错的, 相当的完备, 性能又高 ... -
CloudI 0.0.9 Released, A Cloud as an Interface
2010-03-09 22:32 2476基于Erlang的云平台 看了下代码 质量还是不错的 完成了不 ... -
Memory matters - even in Erlang (再次说明了了解内存如何工作的必要性)
2010-03-09 20:26 3439原文地址:http://www.lshift.net/blog ... -
Some simple examples of using Erlang’s XPath implementation
2010-03-08 23:30 2050原文地址 http://www.lshift.net/blog ... -
lcnt 环境搭建
2010-02-26 16:19 2614抄书:otp_doc_html_R13B04/lib/tool ... -
Erlang强大的代码重构工具 tidier
2010-02-25 16:22 2486Jan 29, 2010 We are very happy ... -
[Feb 24 2010] Erlang/OTP R13B04 has been released
2010-02-25 00:31 1387Erlang/OTP R13B04 has been rele ... -
R13B04 Installation
2010-01-28 10:28 1390R13B04后erlang的源码编译为了考虑移植性,就改变了编 ... -
Running tests
2010-01-19 14:51 1486R13B03以后 OTP的模块加入了大量的测试模块,这些模块都 ... -
R13B04在细化Binary heap
2010-01-14 15:11 1508从github otp的更新日志可以清楚的看到otp R13B ... -
R13B03 binary vheap有助减少binary内存压力
2009-11-29 16:07 1668R13B03 binary vheap有助减少binary内存 ... -
erl_nif 扩展erlang的另外一种方法
2009-11-26 01:02 3218我们知道扩展erl有2种方法, driver和port. 这2 ...
相关推荐
经典密码学资料 Bruce Schneier
演讲内容主要围绕如何处理和识别终端安全宣传中可能存在的误导("Lies and Damn Lies")并超越这些夸大的宣传,来进行实际有效的终端保护产品(EPP)测试。这一点从摘要中“使用营销噱头来执行一个可重复的测试方法...
" Lies, and Damn Lies:.Getting Past the Hype of Endpoint Security Solutions" Endpoint Security Solutions的Market Hype是指各种Endpoint保护解决方案的宣传和marketing策略,旨在吸引客户购买他们的解决方案...
《Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are》+《Principles-Life and Work 2017》
标题 "Giuliano-Lies-And-Damn-Lies-Getting-Past-The-Hype-Of-Endpoint-Security-Solutions" 暗示了这是一份关于网络安全,特别是终端点安全解决方案的深度报告或讨论。作者可能揭示了业界的炒作与现实之间的差距,...
《谎言,该死的谎言或统计数据:如何用统计数据说实话》是一本为本科生设计的免费统计学教科书,作者是科罗拉多州立大学普韦布洛分校的数学与物理学系教授Jonathan A. Poritz。本书旨在教授读者如何正确理解和使用...
对于g∈Z*_n和在其生成的群中的a,logg(a)表示以g为底的a的离散对数,即满足a=g^x mod n的x,其中x属于{-ord(g),...,ord(g)}。 #### 方法概述 ##### 传统方法的问题 - **第一种方法**:虽然能够证明数字属于较小...
Truth_8_Lies_Women_Believe.pdf
4. 大数据时代带来的还有就是A/B test,可以说a/btest是目前互联网公司万能的手段,大到一个产品的定位,小到一个图标的选择,都可以通过a/btest来拿到结果,这是大数据时代独有的方法论,并且已经被证明行之有效,...
together with the Bayesian inference approach, whose essence lies in the use of a hierarchy of probabilistic models. The book presents the major machine learning methods as they have been developed ...
This tutorial text gives a unifying perspective on machine learning by covering both probabilistic and deterministic approaches -which are based on optimization techniques – together with the ...
In this book, you will learn When to use a distributed architecture When and how to use EJB How to develop an efficient data access strategy How to design a clean and maintainable web interface How ...
a reference for many of the most important topics in Graph Theory, it even precisely fulfills the promise of being an effective textbook. The main attention lies to serve the students of Computer ...
with definitions in a very clear and concise form. The presentation is such that readers will not have any difficulty finding any term being looked for. Each definition is written in detail as ...
Clean code that works - now. This is the seeming ...with modern languages and programming environments, and cooks up a tasty stew guaranteed to satisfy your appetite for clean code that works-now.
Ulam’s searching game with a fixed number of lies is not only a fascinating theoretical problem but also has implications for various real-world applications, such as data validation, error ...
Michigan State)**: This problem explores the motion of an object under a central force whose origin lies on a circle, requiring an understanding of polar coordinates and central force equations. ...
In conclusion, the paradox of knowledge lies in the interplay between what we learn and what remains unknown. It highlights the continuous process of discovery and the inherent limitations of human ...