Netty 性能测试(与Tomcat 对比)

2023-11-17

一直以来都认为 Netty 的性能会非常优秀,打算在适当的时候使用它来开发一些要求超高新能的服务。

今天兴致勃勃的写了个简单的 HTTP 服务,同样也用 tomcat 写了一个对比的 jsp 页面。结果测试下来,感觉 Netty 的性能提升并不显著。Netty 中采用的是 NIO 模式。Tomcat 采用了缺省配置。

看来采用 Netty 还要再慎重测试一下。当然这个测试结果也不是特别的严谨。这个结论不是最终结论。

[b]Netty 测试结果[/b]


ab -n 10000 -c 10 http://192.168.1.237:8080/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.237 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests


Server Software:
Server Hostname: 192.168.1.237
Server Port: 8080

Document Path: /
Document Length: 151 bytes

Concurrency Level: 10
Time taken for tests: 5.641704 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 2110000 bytes
HTML transferred: 1510000 bytes
Requests per second: 1772.51 [#/sec] (mean)
Time per request: 5.642 [ms] (mean)
Time per request: 0.564 [ms] (mean, across all concurrent requests)
Transfer rate: 365.14 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.4 0 23
Processing: 1 4 2.1 4 37
Waiting: 0 3 1.9 3 26
Total: 2 4 2.7 5 38

Percentage of the requests served within a certain time (ms)
50% 5
66% 5
75% 5
80% 6
90% 6
95% 8
98% 12
99% 16
100% 38 (longest request)



ab -k -n 10000 -c 10 http://192.168.1.237:8080/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.237 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests


Server Software:
Server Hostname: 192.168.1.237
Server Port: 8080

Document Path: /
Document Length: 151 bytes

Concurrency Level: 10
Time taken for tests: 1.546421 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 10000
Total transferred: 2560768 bytes
HTML transferred: 1510453 bytes
Requests per second: 6466.54 [#/sec] (mean)
Time per request: 1.546 [ms] (mean)
Time per request: 0.155 [ms] (mean, across all concurrent requests)
Transfer rate: 1616.64 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 3
Processing: 0 1 1.9 1 37
Waiting: 0 0 2.1 1 37
Total: 0 1 1.9 1 38

Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 1
80% 1
90% 2
95% 2
98% 5
99% 10
100% 38 (longest request)


[b]Tomcat 测试结果[/b]

ab -n 10000 -c 10 http://192.168.1.237:8080/TestWeb/a.jsp
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.237 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests


Server Software: Apache-Coyote/1.1
Server Hostname: 192.168.1.237
Server Port: 8080

Document Path: /TestWeb/a.jsp
Document Length: 151 bytes

Concurrency Level: 10
Time taken for tests: 5.767970 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 3900000 bytes
HTML transferred: 1510000 bytes
Requests per second: 1733.71 [#/sec] (mean)
Time per request: 5.768 [ms] (mean)
Time per request: 0.577 [ms] (mean, across all concurrent requests)
Transfer rate: 660.20 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.3 1 19
Processing: 0 4 8.8 3 174
Waiting: 0 3 8.6 2 173
Total: 1 5 8.9 4 174

Percentage of the requests served within a certain time (ms)
50% 4
66% 4
75% 5
80% 5
90% 8
95% 10
98% 16
99% 26
100% 174 (longest request)



[code="java"]
ab -k -n 10000 -c 10 http://192.168.1.237:8080/TestWeb/a.jsp
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.237 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests


Server Software: Apache-Coyote/1.1
Server Hostname: 192.168.1.237
Server Port: 8080

Document Path: /TestWeb/a.jsp
Document Length: 151 bytes

Concurrency Level: 10
Time taken for tests: 2.93494 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 9904
Total transferred: 3949520 bytes
HTML transferred: 1510000 bytes
Requests per second: 4776.70 [#/sec] (mean)
Time per request: 2.093 [ms] (mean)
Time per request: 0.209 [ms] (mean, across all concurrent requests)
Transfer rate: 1841.90 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 4
Processing: 0 1 7.4 1 232
Waiting: 0 1 7.4 1 232
Total: 0 1 7.4 1 232

Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 2
80% 2
90% 3
95% 4
98% 8
99% 12
100% 232 (longest request)
# ab -k -n 10000 -c 10 http://192.168.1.237:8080/TestWeb/a.jsp
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.237 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests


Server Software: Apache-Coyote/1.1
Server Hostname: 192.168.1.237
Server Port: 8080

Document Path: /TestWeb/a.jsp
Document Length: 151 bytes

Concurrency Level: 10
Time taken for tests: 2.179860 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 9904
Total transferred: 3950705 bytes
HTML transferred: 1510453 bytes
Requests per second: 4587.45 [#/sec] (mean)
Time per request: 2.180 [ms] (mean)
Time per request: 0.218 [ms] (mean, across all concurrent requests)
Transfer rate: 1769.84 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.2 0 8
Processing: 0 1 10.5 1 329
Waiting: 0 1 10.5 1 329
Total: 0 1 10.5 1 329

Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 2
80% 2
90% 3
95% 4
98% 7
99% 13
100% 329 (longest request)
[/code]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Netty 性能测试(与Tomcat 对比) 的相关文章

随机推荐

  • Windows下C语言操作硬件设备的方法

    本文作者 Fezl 本文原地址 http blog csdn net u010147522 article details 49912221 之前都是在linux下操作硬件设备 open read write ioctl 相当方便 最近要检
  • jQuery 入门教程(23): jQuery UI Autocomplete示例(一)

    AutoComplete 在获取焦点后 随着用户键入的内容 可以在预订的数据源中查找和已输入的内容相匹配的内容列表供用户选择 这可以用作之前输入过的内容也可以用作自动填充相关内容 比如根据城市名 自动填充邮编等 你可以使用本地数据源或是远程
  • nvm的安装及使用、下载cnpm以及git的配置

    nvm下载 下载图中安装包 下载完了就有这个 双击安装 路劲把C改为D即可 这是直接下载选择好安装路劲之后 没配置的环境变量 配置后的环境变量 1 文件夹设置 2 环境变量配置 查询nvm版本号 nvm常用命令如下 使用nvm下载 node
  • 适合初学者的强化学习教程(1): python使用gym实践和注意事项

    作者 知乎 Ai酱 安装步骤和报错问题 安装 pip install gym 报错 AttributeError module gym envs box2d has no attribute BipedalWalker 这是因为gym没有安
  • C语言for循环必备练习题

    话不多说 直接上题 笔者的一贯要求 速度 1 作业标题 663 关于while 条件表达式 循环体 以下叙述正确的是 假设循环体里面没有break continue return goto等等语句 作业内容 A 循环体的执行次数总是比条件表
  • 构造函数初始化列表

    目录 一 初始化列表 二 初始化列表的使用 三 注意 1 每个成员变量在初始化列表中只能出现一次 初始化只能初始化一次 2 类中包含以下成员 必须放在初始化列表位置进行初始化 3 尽量使用初始化列表初始化 因为不管你是否使用初始化列表 对于
  • ubuntu16.04上利用opencv目标跟踪工具实现8种目标跟踪

    一共八种工具 八种工具包括 BOOSTING Tracker 和Haar cascades AdaBoost 背后所用的机器学习算法相同 但是距其诞生已有十多年了 这一追踪器速度较慢 并且表现不好 但是作为元老还是有必要提及的 最低支持Op
  • 操作系统面试题总结

    1 线程与进程的区别联系 2 进程通信方式有哪些 3 同步的方式有哪些 4 ThreadLocal与其它同步机制的比较 5 进程死锁的条件 第一题 1 线程是进程的一个实体 一个进程可以拥有多个线程 多个线程也可以并发执行 一个没有线程的进
  • [Unity 3D] DOTween 常用函数

    DOTween官方文档 http dotween demigiant com documentation php 一 控制变量 1 DOTween To static DOTween To getter setter to float du
  • 端口扫描介绍

    文章目录 1 端口的基本概念 2 端口的常见分类 3 端口扫描原理 1 端口的基本概念 端口 在计算机网络领域中是个非常重要的概念 它是专门为计算机通信而设计的 它不是硬件 不同于计算机中的 插槽 可以说是个 软端口 端口是由计算机的通信协
  • vue+Element-ui 导入excel文件生成json数据

    1 首先安装依赖 import XLSX from xlsx 2 建立读取excel文件的js文件 以便调用 importExcel js import XLSX from xlsx export function readExcel fi
  • java随笔:类成员

    类成员 1 介绍 在java中只能包含成员变量 方法 构造器 初始化块 内部类 接口 枚举 5种成员 其中static可以修饰成员变量 方法 初始化块 内部类 接口 枚举 用static修饰的成员就是类成员 类成员属于整个类 而不属于单独的
  • KLT(Kanade-Lucas-Tomasi )

    目录 光流法 KLT 原理 应用 目标跟踪算法主要分为两类 一类是传统的目标跟踪算法 粒子滤波 pf Mean Shift及KLT算法 或称Lucas光流法 另一大类是基于深度学习的跟踪算法 光流法 光流 Optical flow 其实是指
  • MySQL事务隔离级别、脏读、幻读、不可重复读现象及解决办法、快照读和当前读

    目录 一 事务隔离级别 二 脏读 幻读 不可重复读现象及解决办法 1 脏读 2 不可重复读现象 3 幻读现象 4 使用for update避免幻读 5 使用串行读避免幻读现象 三 快照读与当前读 1 理论 2 RR 下 快照建立时机 第一次
  • Tensorflow Serving 模型部署指南

    文章目录 1 Saver端 模型的离线训练与导出 1 1 saved model 模型保存与载入 1 1 1 简单场景 模型保存 1 1 2 简单场景 模型载入 1 1 3 使用SignatureDef 模型保存 1 1 4 使用Signa
  • 一开机checkingmedia_Win7系统开机提示Checking Media Presence如何解决

    Win7系统在开机的时候 总是会弹出各种各样的错误提示 比如最近就有win732位系统用户反映说开机的时候提示Checking MediaPresence 出现这样的问题可能是启动顺序问题导致的 现在给大家分享一下Win7系统开机提示Che
  • actuator--基础--01--介绍

    actuator 基础 01 介绍 1 介绍 是一个采集应用内部信息暴露给外部的模块 2 提供哪些的功能 健康检查 审计 指标收集 HTTP 跟踪 监控和管理Spring Boot 应用 2 1 访问方式 上述的功能可以通过HTTP 和 J
  • ‘sslSocketFactory(javax.net.ssl.SSLSocketFactory)‘ is deprecated

    sslSocketFactory javax net ssl SSLSocketFactory is deprecated 具体信息如下 public OkHttpClient Builder sslSocketFactory SSLSoc
  • Spring Boot实践 第二章 Spring boot 的配置文件

    前一章 我们创建了第一个spring boot 程序 这一章分享一下spring boot的配置方式和一些技巧 spring boot 的特性之一就是 配置简单 spring boot不再使用之前spring 的xml配置方式 xml的配置
  • Netty 性能测试(与Tomcat 对比)

    一直以来都认为 Netty 的性能会非常优秀 打算在适当的时候使用它来开发一些要求超高新能的服务 今天兴致勃勃的写了个简单的 HTTP 服务 同样也用 tomcat 写了一个对比的 jsp 页面 结果测试下来 感觉 Netty 的性能提升并