- 浏览: 1010958 次
- 性别:
- 来自: 杭州
文章分类
- 全部博客 (826)
- 硬件 (8)
- 软件 (24)
- 软件工程 (34)
- JAVA (229)
- C/C++/C# (77)
- JavaScript (8)
- PHP (1)
- Ruby (3)
- MySQL (14)
- 数据库 (19)
- 心情记事 (12)
- 团队管理 (19)
- Hadoop (1)
- spring (22)
- mybatis(ibatis) (7)
- tomcat (16)
- velocity (0)
- 系统架构 (6)
- JMX (8)
- proxool (1)
- 开发工具 (16)
- python (10)
- JVM (27)
- servlet (5)
- JMS (26)
- ant (2)
- 设计模式 (5)
- 智力题 (2)
- 面试题收集 (1)
- 孙子兵法 (16)
- 测试 (1)
- 数据结构 (7)
- 算法 (22)
- Android (11)
- 汽车驾驶 (1)
- lucene (1)
- memcache (12)
- 技术架构 (7)
- OTP-Erlang (7)
- memcached (17)
- redis (20)
- 浏览器插件 (3)
- sqlite (3)
- Heritrix (9)
- Java线程 (1)
- scala (0)
- Mina (6)
- 汇编 (2)
- Netty (15)
- libevent (0)
- CentOS (12)
- mongod (5)
- mac os (0)
最新评论
-
kingasdfg:
你这里面存在一个错误添加多个任务 应该是这样的 /** * ...
Quartz的任务的临时启动和暂停和恢复【转】 -
kyzeng:
纠正一个错误,long型对应的符号是J,不是L。
Jni中C++和Java的参数传递 -
zhaohaolin:
抱歉,兄弟,只是留下作记录,方便学习,如果觉得资料不好,可以到 ...
netty的个人使用心得【转】 -
cccoooccooco:
谢谢!自己一直以为虚机得使用网线才可以与主机连接呢。。
主机网卡无网线连接与虚拟机通信 -
yuqilin001:
要转别人的东西,请转清楚点嘛,少了这么多类,误人子弟
netty的个人使用心得【转】
压测方案
- 准备多个文件大小分别为 1k 10k 100k 300k
- 使用ab分别按 [50,2000](按50逐渐叠加)压测服务,每次请求10W次
- 硬件信息:CPU:Intel(R) Xeon(R) CPU 1.86GHz ×4 4G
- 统计脚本:grep "Requests per second:" 300k_* | awk -F':' '{print substr($1,6),$3}'|sort -n
- 1k 10k 压测的时候load维持在3左右,100k 300k的load飙升到5 。
压测结果
- 在小文件(小于10k)情况下Netty的性能要优于Tomcat,qps大概能提升50%,而且比Tomcat稳定。
- 在并发量增大时候Netty表现得比Tomcat稳定,通过修改内核加快TIME_WAIT的回收时间,从而提高系统的并发量。
- 在大文件的情况下Netty没有任何优势,而且线程池相关的没有Tomcat优秀,Tomcat的内存回收更优秀些。
- 结论:Netty适合搭建轻量级的应用,特别适合传输内容少,但是并发量非常高的应用。或者是大文件下载服务器。
修改TIME_WAIT回收时间
vi /etc/sysctl.conf net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_fin_timeout = 30 /sbin/sysctl -p
net.ipv4.tcp_syncookies = 1 表示开启SYN Cookies。当出现SYN等待队列溢出时,启用cookies来处理,可防范少量SYN攻击,默认为0,表示关闭; net.ipv4.tcp_tw_reuse = 1 表示开启重用。允许将TIME-WAIT sockets重新用于新的TCP连接,默认为0,表示关闭; net.ipv4.tcp_tw_recycle = 1 表示开启TCP连接中TIME-WAIT sockets的快速回收,默认为0,表示关闭。 net.ipv4.tcp_fin_timeout 修改系統默认的 TIMEOUT 时间
相关数据(下载)
===== Netty ===== ====== 1k ====== 50 15661.50 [#/sec] (mean) 100 13429.52 [#/sec] (mean) 150 15385.05 [#/sec] (mean) 200 15598.34 [#/sec] (mean) 250 15135.97 [#/sec] (mean) 300 13494.79 [#/sec] (mean) 350 15102.49 [#/sec] (mean) 400 14614.11 [#/sec] (mean) 450 13463.52 [#/sec] (mean) 500 13447.48 [#/sec] (mean) 550 13126.29 [#/sec] (mean) 600 11108.25 [#/sec] (mean) 650 11073.34 [#/sec] (mean) 700 14518.88 [#/sec] (mean) 750 13409.66 [#/sec] (mean) 800 13060.86 [#/sec] (mean) 850 11938.25 [#/sec] (mean) 900 13133.88 [#/sec] (mean) 950 13670.75 [#/sec] (mean) 1000 13803.70 [#/sec] (mean) 1050 16414.20 [#/sec] (mean) 1100 14770.09 [#/sec] (mean) 1150 11108.65 [#/sec] (mean) 1200 13294.72 [#/sec] (mean) 1250 13448.52 [#/sec] (mean) 1300 15128.31 [#/sec] (mean) 1350 13367.31 [#/sec] (mean) 1400 14277.91 [#/sec] (mean) 1450 13193.80 [#/sec] (mean) 1500 14272.63 [#/sec] (mean) 1550 11004.96 [#/sec] (mean) 1600 13438.72 [#/sec] (mean) 1650 13105.43 [#/sec] (mean) 1700 13653.39 [#/sec] (mean) 1750 13366.72 [#/sec] (mean) 1800 12727.40 [#/sec] (mean) 1850 13075.32 [#/sec] (mean) 1900 11103.91 [#/sec] (mean) 1950 13463.83 [#/sec] (mean) ====== 10k ====== 50 7280.51 [#/sec] (mean) 100 9089.69 [#/sec] (mean) 150 9423.90 [#/sec] (mean) 200 8130.07 [#/sec] (mean) 250 8142.88 [#/sec] (mean) 300 8311.20 [#/sec] (mean) 350 8512.20 [#/sec] (mean) 400 7940.84 [#/sec] (mean) 450 7823.32 [#/sec] (mean) 500 8284.60 [#/sec] (mean) 550 8785.93 [#/sec] (mean) 600 7725.20 [#/sec] (mean) 650 7753.23 [#/sec] (mean) 700 8184.61 [#/sec] (mean) 750 8027.75 [#/sec] (mean) 800 7934.49 [#/sec] (mean) 850 7792.94 [#/sec] (mean) 900 7734.34 [#/sec] (mean) 950 7118.27 [#/sec] (mean) 1000 7866.23 [#/sec] (mean) 1050 7724.82 [#/sec] (mean) 1100 7734.17 [#/sec] (mean) 1150 7688.83 [#/sec] (mean) 1200 7359.90 [#/sec] (mean) 1250 7526.02 [#/sec] (mean) 1300 7515.24 [#/sec] (mean) 1350 6639.51 [#/sec] (mean) 1400 7902.36 [#/sec] (mean) 1450 7447.63 [#/sec] (mean) 1500 8216.35 [#/sec] (mean) 1550 8133.42 [#/sec] (mean) 1600 7728.28 [#/sec] (mean) 1650 7724.26 [#/sec] (mean) 1700 7622.26 [#/sec] (mean) 1750 7848.25 [#/sec] (mean) 1800 7715.88 [#/sec] (mean) 1850 7594.04 [#/sec] (mean) 1900 8017.95 [#/sec] (mean) 1950 7992.33 [#/sec] (mean) ====== 100k ====== 50 1079.56 [#/sec] (mean) 100 1078.64 [#/sec] (mean) 150 1080.74 [#/sec] (mean) 200 1074.42 [#/sec] (mean) 250 1082.69 [#/sec] (mean) 300 1084.87 [#/sec] (mean) 350 1080.00 [#/sec] (mean) 400 1046.49 [#/sec] (mean) 450 1050.25 [#/sec] (mean) 500 1052.89 [#/sec] (mean) 550 1046.49 [#/sec] (mean) 600 1059.16 [#/sec] (mean) 650 1051.33 [#/sec] (mean) 700 1050.23 [#/sec] (mean) 750 1045.41 [#/sec] (mean) 800 1054.51 [#/sec] (mean) 850 1034.61 [#/sec] (mean) 900 1045.55 [#/sec] (mean) 950 1036.36 [#/sec] (mean) ====== 3000k ====== 50 345.95 [#/sec] (mean) 100 355.97 [#/sec] (mean) 150 361.02 [#/sec] (mean) 200 363.39 [#/sec] (mean) 250 358.99 [#/sec] (mean) 300 332.52 [#/sec] (mean) 350 320.66 [#/sec] (mean) 400 315.49 [#/sec] (mean) 450 305.72 [#/sec] (mean) 900 304.57 [#/sec] (mean) ===== Tomcat ===== ====== 1k ====== 50 8808.85 [#/sec] (mean) 100 9933.93 [#/sec] (mean) 150 11037.66 [#/sec] (mean) 200 10857.99 [#/sec] (mean) 250 10389.63 [#/sec] (mean) 300 11054.51 [#/sec] (mean) 350 10397.66 [#/sec] (mean) 400 10617.54 [#/sec] (mean) 450 9600.62 [#/sec] (mean) 500 10822.00 [#/sec] (mean) 550 10815.92 [#/sec] (mean) 600 11385.86 [#/sec] (mean) 650 11094.66 [#/sec] (mean) 700 10819.33 [#/sec] (mean) 750 10821.28 [#/sec] (mean) 800 9009.25 [#/sec] (mean) 850 10814.18 [#/sec] (mean) 900 9542.68 [#/sec] (mean) 950 11095.51 [#/sec] (mean) 1000 10811.53 [#/sec] (mean) 1050 11084.72 [#/sec] (mean) 1100 11089.07 [#/sec] (mean) 1150 9590.15 [#/sec] (mean) 1200 13826.40 [#/sec] (mean) 1250 8186.03 [#/sec] (mean) 1300 13961.24 [#/sec] (mean) 1350 11077.12 [#/sec] (mean) 1400 16536.29 [#/sec] (mean) 1450 11430.66 [#/sec] (mean) 1500 10817.56 [#/sec] (mean) 1550 16195.09 [#/sec] (mean) 1600 17205.66 [#/sec] (mean) 1650 13300.61 [#/sec] (mean) 1700 11061.43 [#/sec] (mean) 1750 10837.05 [#/sec] (mean) 1800 9786.94 [#/sec] (mean) 1850 10808.81 [#/sec] (mean) 1900 13019.67 [#/sec] (mean) 1950 10090.06 [#/sec] (mean) ====== 10k ====== 50 5513.00 [#/sec] (mean) 100 7093.53 [#/sec] (mean) 150 9134.78 [#/sec] (mean) 200 8910.81 [#/sec] (mean) 250 9240.74 [#/sec] (mean) 300 7805.80 [#/sec] (mean) 350 8661.73 [#/sec] (mean) 400 8835.57 [#/sec] (mean) 450 7966.94 [#/sec] (mean) 500 8322.71 [#/sec] (mean) 550 6575.24 [#/sec] (mean) 600 8726.30 [#/sec] (mean) 650 8108.30 [#/sec] (mean) 700 9226.79 [#/sec] (mean) 750 8834.83 [#/sec] (mean) 800 8386.70 [#/sec] (mean) 850 8380.58 [#/sec] (mean) 900 8323.48 [#/sec] (mean) 950 9060.00 [#/sec] (mean) 1000 7213.51 [#/sec] (mean) 1050 9504.06 [#/sec] (mean) 1100 9381.86 [#/sec] (mean) 1150 8839.41 [#/sec] (mean) 1200 9760.02 [#/sec] (mean) 1250 9476.96 [#/sec] (mean) 1300 8366.04 [#/sec] (mean) 1350 9651.87 [#/sec] (mean) 1400 9186.07 [#/sec] (mean) 1450 9600.16 [#/sec] (mean) 1500 8289.33 [#/sec] (mean) 1550 9399.26 [#/sec] (mean) 1600 8205.92 [#/sec] (mean) 1650 8306.61 [#/sec] (mean) 1700 9464.74 [#/sec] (mean) 1750 8682.26 [#/sec] (mean) 1800 9589.63 [#/sec] (mean) 1850 8315.31 [#/sec] (mean) 1900 9174.38 [#/sec] (mean) 1950 8956.78 [#/sec] (mean) ====== 100k ====== 50 1033.41 [#/sec] (mean) 100 1054.92 [#/sec] (mean) 150 1061.72 [#/sec] (mean) 200 1075.20 [#/sec] (mean) 300 373.05 [#/sec] (mean) 350 375.34 [#/sec] (mean) 400 376.29 [#/sec] (mean) 450 376.51 [#/sec] (mean) 500 377.04 [#/sec] (mean) 550 377.09 [#/sec] (mean) 650 363.08 [#/sec] (mean) 700 368.69 [#/sec] (mean) ====== 300k ====== 50 354.93 [#/sec] (mean) 100 361.82 [#/sec] (mean) 150 366.71 [#/sec] (mean) 200 369.58 [#/sec] (mean) 250 372.58 [#/sec] (mean) 300 374.43 [#/sec] (mean) 350 375.92 [#/sec] (mean) 400 376.23 [#/sec] (mean) 450 376.93 [#/sec] (mean) 500 376.61 [#/sec] (mean) 550 377.67 [#/sec] (mean) 600 372.58 [#/sec] (mean)
发表评论
-
调试jdk中的源码,查看jdk局部变量
2013-06-15 23:30 1048调试jdk中的源码,查看jdk局部变量 2012-04 ... -
Reactor模式和NIO<转>
2013-05-27 14:20 869本文可看成是对Doug Lea Scalable IO in ... -
Eclipse快捷键 10个最有用的快捷键<转>
2013-04-11 23:28 1067Eclipse中10个最有用的快捷键组合 一个Eclip ... -
Lucene 3.6 中文分词、分页查询、高亮显示等
2012-12-09 23:35 18101、准备工作 下载lucene 3.6.1 : htt ... -
Maven实战(九)——打包的技巧(转)
2012-10-12 00:41 932“打包“这个词听起 ... -
基于Maven的web工程如何配置嵌入式Jetty Server开发调试环境(转)
2012-10-12 00:28 9161、首先在web工程的POM文件里添加依赖jar包如下: ... -
轻轻松松学Solr(1)--概述及安装[转]
2012-09-18 14:59 990概述 这段时间对企 ... -
分析Netty工作流程[转]
2012-09-04 19:02 883下面以Netty中Echo的例 ... -
让eclipse在ubuntu下面好看一点
2012-03-27 10:17 914<p> </p> <h1 cla ... -
zookeeper安装和应用场合(名字,配置,锁,队列,集群管理)[转]
2012-01-12 17:59 1646安装和配置详解 本文 ... -
Jakarta-Common-BeanUtils使用笔记[转]
2012-01-10 14:13 1153Jakarta-Common-BeanUtils ... -
一个关于Java Thread wait(),notify()的实用例【转】
2012-01-07 16:05 1019///// // ProducerConsume ... -
Java基础:Java中的 assert 关键字解析【转】
2012-01-06 19:50 1056J2SE 1.4在语言上提供了 ... -
一篇不错的讲解Java异常的文章(转载)----感觉很不错,读了以后很有启发[转]
2012-01-06 15:02 1259六种异常处理的陋习 ... -
如何解决HP QC(Quality Center)在Windows 7下不能工作的问题
2011-12-26 10:48 1574HP QC(Quantity Center) 是一款不错的测 ... -
JAVA读写文件,中文乱码 【转】
2011-12-19 23:43 2114最近在做HTML静态生成,需要从硬盘上把模版文件的内容读出来。 ... -
Java 6 JVM参数选项大全(中文版)【转】
2011-12-19 19:51 965Java 6 JVM参数选项大全(中文版) 作者 ... -
使用assembly plugin实现自定义打包【转】
2011-12-13 01:58 965在上一篇文章中,讨论到在对maven的机制不熟悉的情况下,为了 ... -
使用maven ant task实现非标准打包[转]
2011-12-13 01:56 1045maven很强大,但是总有些事情干起来不是得心应手,没有使用a ... -
Java日期转换SimpleDateFormat格式大全【转】
2011-12-08 20:22 130924小时制时间 显示: public clas ...
相关推荐
赠送jar包:netty-transport-native-unix-common-4.1.73.Final.jar; 赠送原API文档:netty-transport-native-unix-common-4.1.73.Final-javadoc.jar; 赠送源代码:netty-transport-native-unix-common-4.1.73....
赠送jar包:netty-transport-native-unix-common-4.1.74.Final.jar; 赠送原API文档:netty-transport-native-unix-common-4.1.74.Final-javadoc.jar; 赠送源代码:netty-transport-native-unix-common-4.1.74....
赠送jar包:netty-transport-classes-epoll-4.1.73.Final.jar; 赠送原API文档:netty-transport-classes-epoll-4.1.73.Final-javadoc.jar; 赠送源代码:netty-transport-classes-epoll-4.1.73.Final-sources.jar;...
赠送jar包:netty-transport-native-unix-common-4.1.68.Final.jar; 赠送原API文档:netty-transport-native-unix-common-4.1.68.Final-javadoc.jar; 赠送源代码:netty-transport-native-unix-common-4.1.68....
赠送jar包:netty-transport-classes-epoll-4.1.74.Final.jar; 赠送原API文档:netty-transport-classes-epoll-4.1.74.Final-javadoc.jar; 赠送源代码:netty-transport-classes-epoll-4.1.74.Final-sources.jar;...
赠送jar包:netty-transport-classes-epoll-4.1.73.Final.jar; 赠送原API文档:netty-transport-classes-epoll-4.1.73.Final-javadoc.jar; 赠送源代码:netty-transport-classes-epoll-4.1.73.Final-sources.jar;...
赠送jar包:reactor-netty-core-1.0.15.jar; 赠送原API文档:reactor-netty-core-1.0.15-javadoc.jar; 赠送源代码:reactor-netty-core-1.0.15-sources.jar; 赠送Maven依赖信息文件:reactor-netty-core-1.0.15....
赠送jar包:reactor-netty-http-1.0.11.jar; 赠送原API文档:reactor-netty-http-1.0.11-javadoc.jar; 赠送源代码:reactor-netty-http-1.0.11-sources.jar; 赠送Maven依赖信息文件:reactor-netty-...
赠送jar包:netty-transport-native-unix-common-4.1.73.Final.jar; 赠送原API文档:netty-transport-native-unix-common-4.1.73.Final-javadoc.jar; 赠送源代码:netty-transport-native-unix-common-4.1.73....
赠送jar包:netty-resolver-dns-4.1.65.Final.jar; 赠送原API文档:netty-resolver-dns-4.1.65.Final-javadoc.jar; 赠送源代码:netty-resolver-dns-4.1.65.Final-sources.jar; 赠送Maven依赖信息文件:netty-...
赠送jar包:netty-codec-mqtt-4.1.74.Final.jar; 赠送原API文档:netty-codec-mqtt-4.1.74.Final-javadoc.jar; 赠送源代码:netty-codec-mqtt-4.1.74.Final-sources.jar; 赠送Maven依赖信息文件:netty-codec-...
赠送jar包:netty-codec-haproxy-4.1.73.Final.jar; 赠送原API文档:netty-codec-haproxy-4.1.73.Final-javadoc.jar; 赠送源代码:netty-codec-haproxy-4.1.73.Final-sources.jar; 赠送Maven依赖信息文件:netty-...
赠送jar包:netty-codec-dns-4.1.65.Final.jar; 赠送原API文档:netty-codec-dns-4.1.65.Final-javadoc.jar; 赠送源代码:netty-codec-dns-4.1.65.Final-sources.jar; 赠送Maven依赖信息文件:netty-codec-dns-...
赠送jar包:netty-resolver-dns-4.1.65.Final.jar; 赠送原API文档:netty-resolver-dns-4.1.65.Final-javadoc.jar; 赠送源代码:netty-resolver-dns-4.1.65.Final-sources.jar; 赠送Maven依赖信息文件:netty-...
赠送jar包:netty-codec-mqtt-4.1.73.Final.jar; 赠送原API文档:netty-codec-mqtt-4.1.73.Final-javadoc.jar; 赠送源代码:netty-codec-mqtt-4.1.73.Final-sources.jar; 赠送Maven依赖信息文件:netty-codec-...
赠送jar包:netty-resolver-dns-4.1.73.Final.jar; 赠送原API文档:netty-resolver-dns-4.1.73.Final-javadoc.jar; 赠送源代码:netty-resolver-dns-4.1.73.Final-sources.jar; 赠送Maven依赖信息文件:netty-...
赠送jar包:netty-codec-http-4.1.27.Final.jar; 赠送原API文档:netty-codec-http-4.1.27.Final-javadoc.jar; 赠送源代码:netty-codec-http-4.1.27.Final-sources.jar; 赠送Maven依赖信息文件:netty-codec-...
赠送jar包:netty-tcnative-classes-2.0.46.Final.jar; 赠送原API文档:netty-tcnative-classes-2.0.46.Final-javadoc.jar; 赠送源代码:netty-tcnative-classes-2.0.46.Final-sources.jar; 赠送Maven依赖信息...
赠送jar包:netty-codec-http-4.1.11.Final.jar; 赠送原API文档:netty-codec-http-4.1.11.Final-javadoc.jar; 赠送源代码:netty-codec-http-4.1.11.Final-sources.jar; 赠送Maven依赖信息文件:netty-codec-...
netty-socketio-netty-socketio-2.0.6 ,Socket.IO 是一个库,可以在客户端和服务器之间实现低延迟, 双向和基于事件的通信:netty-socketio-netty-socketio-2.0.6.tar.gznetty-socketio-netty-socketio-2.0.6.zip