一、
以下摘录自企业级分布式应用服务EDAS官网段落

RPC服务

提供对Dubbo和HSF两个RPC框架的支持。阿里巴巴第一代RPC框架Dubbo是国内第一款成熟的商用级RPC框架,已于2011年正式对外开源,目前已发展成为国内开源价值最高、用户使用规模最大的开源软件之一。最新一代RPC框架HSF,全称High Speed Framework,也叫"好舒服","很舒服"框架,是阿里内部对这一款高性能服务框架的昵称,是一款面向企业级互联网架构量身定制的分布式服务框架。HSF以高性能网络通信框架为基础,提供了诸如服务发布与注册,服务调用,服务路由,服务鉴权,服务限流,服务降级和服务调用链路跟踪等一系列久经考验的功能特性。

来源:企业级分布式应用服务EDAS_企业云计算解决方案

 
 
二、

dubbo和S-HSF测试对比

今天没什么事,简单测试下RPC框架性能: HSF完胜dubbo

1.dubbo测试结果:

note:

dubbo测试时有使用ZooKeeper,所以存在不公平性,不一定准确。

同步模型

耗时:16.808 s

平均:0.16808 ms

TPS:5949.547834364588

测试数据:

  1. public class TPS_TEST {
  2. public static void main(String[] args) throws InterruptedException {
  3. final ClassPathXmlApplicationContext context =
  4. new ClassPathXmlApplicationContext(
  5. new String[] {"file:E:/1-project_test/dubbox-master/dubbo-demo/dubbo-demo-consumer/src/main/resources/META-INF/spring/dubbo-demo-consumer.xml"});
  6. final HelloService helloService = (HelloService)context.getBean("helloService"); // get service invocation proxy
  7. ExecutorService executorServicePool = Executors.newFixedThreadPool(200);
  8. final int size = 100000;
  9. final CountDownLatch cdl = new CountDownLatch(size);
  10. long begin = System.currentTimeMillis();
  11. for (int i = 0; i < size; i++) {
  12. executorServicePool.execute(new Runnable() {
  13. @Override
  14. public void run() {
  15. try {
  16. String hello = helloService.hello("aa"); // do invoke!
  17. //System.out.println( hello ); // cool, how are you~
  18. cdl.countDown();
  19. } catch (Exception e) {
  20. e.printStackTrace();
  21. }
  22. }
  23. });
  24. }
  25. //executorServicePool.shutdown();
  26. //executorService.awaitTermination(10, TimeUnit.MINUTES);
  27. cdl.await();//等待所有任务处理完
  28. long time = System.currentTimeMillis() - begin;
  29. System.out.println("耗时:" + (double) time / 1000 + " s");
  30. System.out.println("平均:" + ((double) time) / size +" ms");
  31. System.out.println("TPS:" + (double) size / ((double) time / 1000));
  32. }
  33. }

2.hsf 测试结果:

异步模型:

耗时:6.305 s

平均:0.06305 ms

TPS:15860.428231562253

测试数据:

  1. public class Client {
  2. public static void main(String[] args) throws InterruptedException, ExecutionException {
  3. final int size = 100000;
  4. final CountDownLatch cdl = new CountDownLatch(size);
  5. // final TestService testService = ServiceProxyFactory.getRoundFactoryInstance(connector).wrapAsyncProxy(
  6. // TestService.class);
  7. HsfConnector connector = new HsfConnectorImpl();
  8. connector.connect(new InetSocketAddress("localhost", 8082));
  9. final TestService testService = ServiceProxyFactory.getRoundFactoryInstance(connector).wrapAsyncCallbackProxy(
  10. TestService.class, new AsyncCallback<Object>() {
  11. public void doCallback(Object data) {
  12. //System.out.println("received:" + data);
  13. cdl.countDown();
  14. };
  15. @Override
  16. public void doExceptionCaught(Throwable ex, HsfChannel channel, Object param) {
  17. System.out.println(ex);
  18. super.doExceptionCaught(ex, channel, param);
  19. }
  20. });
  21. ExecutorService executorServicePool = Executors.newFixedThreadPool(200);
  22. long begin = System.currentTimeMillis();
  23. for (int i = 0; i < size; i++) {
  24. executorServicePool.execute(new Runnable() {
  25. @Override
  26. public void run() {
  27. try {
  28. testService.test("aa");
  29. } catch (Exception e) {
  30. e.printStackTrace();
  31. }
  32. }
  33. });
  34. }
  35. //executorServicePool.shutdown();
  36. //executorService.awaitTermination(10, TimeUnit.MINUTES);
  37. cdl.await();//等待所有任务处理完
  38. long time = System.currentTimeMillis() - begin;
  39. System.out.println("耗时:" + (double) time / 1000 + " s");
  40. System.out.println("平均:" + ((double) time) / size +" ms");
  41. System.out.println("TPS:" + (double) size / ((double) time / 1000));
  42. }
  43. }

同步模型:

耗时:9.446 s

平均:0.09446 ms

TPS:10586.491636671608

  1. //tips:
  2. //模拟HSF的同步模型:在10万个并发线程发送数据时有时候比异步模型还要快,这点有点想不通,估计是我测试的服务是直接return的场景吧。
  3. /**
  4. * @Title: Client.java
  5. * @Description: TODO(添加描述)
  6. * @date 2012-2-23 上午01:01:33
  7. * @version V1.0
  8. */
  9. public class Client2 {
  10. public static void main(String[] args) throws InterruptedException, ExecutionException {
  11. final int size = 100000;
  12. final CountDownLatch cdl = new CountDownLatch(size);
  13. HsfConnector connector = new HsfConnectorImpl();
  14. connector.connect(new InetSocketAddress("10.118.63.12", 10223));
  15. /*
  16. final TestService testService = ServiceProxyFactory.getRoundFactoryInstance(connector).wrapAsyncCallbackProxy(
  17. TestService.class, new AsyncCallback<Object>() {
  18. public void doCallback(Object data) {
  19. //System.out.println("received:" + data);
  20. cdl.countDown();
  21. };
  22. @Override
  23. public void doExceptionCaught(Throwable ex, HsfChannel channel, Object param) {
  24. System.out.println(ex);
  25. super.doExceptionCaught(ex, channel, param);
  26. }
  27. });
  28. ExecutorService executorServicePool = Executors.newFixedThreadPool(200);
  29. long begin = System.currentTimeMillis();
  30. for (int i = 0; i < size; i++) {
  31. executorServicePool.execute(new Runnable() {
  32. @Override
  33. public void run() {
  34. try {
  35. testService.test("aa");
  36. } catch (Exception e) {
  37. e.printStackTrace();
  38. }
  39. }
  40. });
  41. }
  42. */
  43. final TestService testService = ServiceProxyFactory.getRoundFactoryInstance(connector).wrapSyncProxy(
  44. TestService.class);
  45. ExecutorService executorServicePool = Executors.newFixedThreadPool(200);
  46. long begin = System.currentTimeMillis();
  47. for (int i = 0; i < size; i++) {
  48. executorServicePool.execute(new Runnable() {
  49. @Override
  50. public void run() {
  51. try {
  52. String hello = testService.test("aa");
  53. cdl.countDown();
  54. } catch (Exception e) {
  55. e.printStackTrace();
  56. }
  57. }
  58. });
  59. }
  60. //executorServicePool.shutdown();
  61. //executorService.awaitTermination(10, TimeUnit.MINUTES);
  62. cdl.await();//等待所有任务处理完
  63. long time = System.currentTimeMillis() - begin;
  64. System.out.println("耗时:" + (double) time / 1000 + " s");
  65. System.out.println("平均:" + ((double) time) / size +" ms");
  66. System.out.println("TPS:" + (double) size / ((double) time / 1000));
  67. }

来源:

 
相关:

HSF和Dubbo有什么区别的更多相关文章

  1. RPC实现原理(HSF、dubbo) 从头开始(一)

    前言 阔别了很久博客园,虽然看了以前写的很多东西感觉好幼稚,但是还是觉得应该把一些自己觉得有用的东西和大家分享.废话不多说,现在开始进入正题. 之前的六年工作经验,呆过了一些大公司,每个在大公司呆过的 ...

  2. 阿里巴巴为什么主推HSF?比Dubbo有哪些优势?

    作者:匿名用户链接:https://www.zhihu.com/question/39560697/answer/187538165来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请 ...

  3. SpringCloud 和 Dubbo 有哪些区别?

    首先,他们都是分布式管理框架.    dubbo 是二进制传输,占用带宽会少一点.SpringCloud是http 传输,带宽会多一点,同时使用http协议一般会使用JSON报文,消耗会更大.    ...

  4. Dubbo与Nginx区别

    Dubbo的负载均衡已经是服务层面的了,和nginx的负载均衡还在http请求层面完全不同.至于二者哪个优秀,当然没办法直接比较. 涉及到负载均衡就涉及到你的业务,根据业务来选择才是最适合的. dub ...

  5. hsf

    参考文章: ----- 架构和框架的区别 1.HSF源码剖析 2.Http和RPC区别 3.分布式服务框架HSF 4.高并发架构系列:如何从0到1设计一个类Dubbo的RPC框架 5.HSF的原理分析 ...

  6. dubbo&hsf&spring-cloud简单介绍

    Dubbo: 简介:Dubbo是一个分布式服务框架,以及SOA治理方案.其功能主要包括:高性能NIO通讯及多协议集成,服务动态寻址与路由,软负载均衡与容错,依赖分析与降级等. 底部NIO基于netty ...

  7. Spring Cloud,Dubbo及HSF对比

    Round 1:背景 Dubbo,是阿里巴巴服务化治理的核心框架,并被广泛应用于阿里巴巴集团的各成员站点.阿里巴巴近几年对开源社区的贡献不论在国内还是国外都是引人注目的,比如:JStorm捐赠给Apa ...

  8. 基于RPC原理的dubbo

    在校期间大家都写过不少程序,比如写个hello world服务类,然后本地调用下,如下所示.这些程序的特点是服务消费方和服务提供方是本地调用关系. 而一旦踏入公司尤其是大型互联网公司就会发现,公司的系 ...

  9. Spring Cloud介绍 Spring Cloud与Dubbo对比

    spring Cloud是一个基于Spring Boot实现的云应用开发工具,它为基于JVM的云应用开发中的配置管理.服务发现.断路器.智能路由.微代理.控制总线.全局锁.决策竞选.分布式会话和集群状 ...

随机推荐

  1. 安装 Visual Studio Web Tools 的奇怪问题

    安装Microsoft ASP.NET 5 RC 1 时提示 0x80070005 - 拒绝访问 日志文件为 [1968:3F64][2015-11-20T10:08:36]i010: Launchi ...

  2. 【2016-11-3】【坚持学习】【Day18】【我认识的ORM】

    我学过或者用过的ORM有几种 EF NHibernate DevExpress  xpo (第一家公司用这个,也是很省力的orm,现在已经不记得了.) 今天晚上想找一下有没有轻量级的orm: flue ...

  3. 有关sql server 2008无法导入数据库mdf文件的处理方法

    解决方法1:根据该博客中的引导,加上自己安装版本的细节,可以添加成功 http://www.2cto.com/database/201408/328930.html 解决方法2: 根据<数据库系 ...

  4. MyBatis 智能标签

    使用Where 只能标签 检索部门Y2162Dept 数据库已存在表Y2162Dept 实现动态查询 Deptno Deptname 赋值 不赋值 不赋值 赋值 赋值 赋值 不赋值 不赋值 <! ...

  5. 面试题:return和finally执行

    创建一个包含return和finally的方法:(如下所示) public class Demo { public int get() { int x=1; try { x++; return x; ...

  6. Java面向对象 第一章 面向对象开发方法概述

    一.软件开发经历的生命周期: ①软件分析 ②软件设计 ③软件编码 ④ 软件测试 ⑤ 软件部署 ⑥软件维护 二.为了提高软件开发效率,降低软件开发成本,一个优良的软件系统应该具备以下特点: ① 可重用性 ...

  7. Winform无边框窗体的移动和阴影

    //窗体移动API [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport ...

  8. 生产环境使用 pt-table-checksum 检查MySQL数据一致性

    公司数据中心从托管机房迁移到阿里云,需要对mysql迁移(Replication)后的数据一致性进行校验,但又不能对生产环境使用造成影响,pt-table-checksum 成为了绝佳也是唯一的检查工 ...

  9. Mysql更换MyISAM存储引擎为Innodb的操作记录

    一般情况下,mysql会默认提供多种存储引擎,可以通过下面的查看: 1)查看mysql是否安装了innodb插件.通过下面的命令结果可知,已经安装了innodb插件. mysql> show p ...

  10. angular监听

    监听中第三个参数,何时使用true? true的意思是“深度监听” 1.当监听对象属性变化时,而你监听的对象写得是对象,此时要用深度监听true: 2....... 监听耗资源,用完关闭 var wa ...