.net node.js Scala 网络性能测试

2015-08-16 09:56:16 +08:00
 loqixh

具体可看 https://github.com/aspnet/benchmarks

Benchmarks

A playground for experimenting with different server models.

Environment

We're using the following physical machines to perform these tests:

Name OS Role CPU RAM NIC Notes
perfsvr Windows Server 2012 R2 Web Server Xeon E5-1650 32 GB Intel® Ethernet Converged Network Adapter X540-T1 10GbE
perfsvr2 Ubuntu 14.04 LTS Web Server & Load Generator Xeon E5-1620 32 GB Intel® Ethernet Converged Network Adapter X540-T1 10GbE
perf02 Windows Server 2012 R2 Load Generator Xeon W3550 24 GB Broadcom NetXtreme Gigabit Ethernet (BCM5764)
perf03 Ubuntu 14.04 LTS Load Generator Xeon W3550 12 GB Intel® Ethernet Converged Network Adapter X540-T1 10GbE

The machines are connected to an 8-port Netgear XS708E 10-Gigabit switch.

Load Generation

We're using wrk to generate load from one of our Linux boxes (usually perfsvr2). We also have WCAT) set up on perf02 but it as it doesn't support HTTP pipelining we've stopped using it for now.

Results

For each stack, variations of the load parameters and multiple runs are tested and the highest result is recorded.

Plain Text

Similar to the plain text benchmark in the TechEmpower tests. Intended to highlight the HTTP efficiency of the server & stack. Implementations are free to cache aggressively and remove/disable components that aren't required in order to maximize performance.

Stack Server Req/sec Load Params Impl Observations
ASP.NET 4.6 perfsvr 65,383 8 threads, 512 connections Generic reusable handler, unused IIS modules removed CPU is 100%, almost exclusively in user mode
IIS Static File (kernel cached) perfsvr 276,727 8 threads, 512 connections hello.html containing "HelloWorld" CPU is 36%, almost exclusively in kernel mode
IIS Static File (non-kernel cached) perfsvr 231,609 8 threads, 512 connections hello.html containing "HelloWorld" CPU is 100%, almost exclusively in user mode
ASP.NET 5 on WebListener (kernel cached) perfsvr 264,117 8 threads, 512 connections Just app.Run() CPU is 36%, almost exclusively in kernel mode
ASP.NET 5 on WebListener (non-kernel cached) perfsvr 107,315 8 threads, 512 connections Just app.Run() CPU is 100%, mostly in user mode
ASP.NET 5 on IIS (Helios) (non-kernel cached) perfsvr 109,560 8 threads, 512 connections Just app.Run() CPU is 100%, mostly in user mode
NodeJS perfsvr 96,558 8 threads, 1024 connections The actual TechEmpower NodeJS app CPU is 100%, almost exclusively in user mode
Scala perfsvr 204,009 8 threads, 1024 connections The actual TechEmpower Scala plain text app CPU is 68%, mostly in kernel mode
libuv C# perfsvr 300,507 12 threads, 1024 connections Simple TCP server, not real HTTP yet, load spread across 12 ports (port/thread/CPU) CPU is 54%, mostly in kernel mode

Plain Text with HTTP Pipelining

Like the Plain Text scenario above but with HTTP pipelining enabled. Only stacks/servers that support pipelining are included.

Stack Server Req/sec Load Params Impl Observations
NodeJS perfsvr 148,934 8 threads, 1024 connections The actual TechEmpower NodeJS app CPU is 100%, almost exclusively in user mode
Scala perfsvr 764,775 8 threads, 1024 connections, pipelining 15 deep The actual TechEmpower Scala plain text app CPU is 46%, mostly in kernel mode, 1Gbps NIC saturated (need to re-run on 10GbE)
libuv C# perfsvr 2,379,267 36 threads, 288 connections, pipelining 15 deep Simple TCP server, not real HTTP yet, load spread across 12 ports (port/thread/CPU) CPU is 100%, mostly in user mode, gets slower as test runs longer, issue somewhere

Plain Text with HTTP 2

Coming soon...

JSON

Coming soon...


This project is part of ASP.NET 5. You can find samples, documentation and getting started instructions for ASP.NET 5 at the Home repo.

4191 次点击
所在节点    Node.js
6 条回复
zonghua
2015-08-16 10:56:02 +08:00
业务逻辑没法进行对比啊,能说明什么问题呢?
yakczh
2015-08-16 11:00:08 +08:00
为什么iis/asp.net只容许 512个链接 要么都是512,要么都是1024, 这样比较才公平 吧
loqixh
2015-08-16 11:00:35 +08:00
@zonghua cpu花在虚拟机上,传说中的node.js性能高太虚
loqixh
2015-08-16 11:02:58 +08:00
@yakczh iis是打酱油的,看libuv C#比较有效果,和node.js一样的网络引擎
loqixh
2015-08-16 11:04:05 +08:00
@yakczh cpu100%了
yakczh
2015-08-16 11:18:39 +08:00
@loqixh 那应该出两分,一份512 一份1024 比较要在相同基准下才有意义

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/213501

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX