zoukankan      html  css  js  c++  java
  • DUBBO Thread pool is EXHAUSTED!

    一、问题

    在测试环境遇到的异常信息,如下:

    16-10-17 00:00:00.033 [New I/O server worker #1-6] WARN  com.alibaba.dubbo.common.threadpool.support.AbortPolicyWithReport -  [DUBBO] Thread pool is EXHAUSTED! Thread Name: DubboServerHandler-10.0.0.77:20703, Pool Size: 500 (active: 500, core: 500, max: 500, largest: 500), Task: 5897697 (completed: 5897197), Executor status:(isShutdown:false, isTerminated:false, isTerminating:false), in dubbo://10.0.0.77:20703!, dubbo version: 2.5.3, current host: 127.0.0.1
    16-10-17 00:00:00.033 [New I/O server worker #1-6] WARN  org.jboss.netty.channel.DefaultChannelPipeline -  [DUBBO] An exception was thrown by a user handler while handling an exception event ([id: 0x3c650867, /10.0.0.83:53184 => /10.0.0.77:20703] EXCEPTION: com.alibaba.dubbo.remoting.ExecutionException: class com.alibaba.dubbo.remoting.transport.dispatcher.all.AllChannelHandler error when process received event .), dubbo version: 2.5.3, current host: 127.0.0.1
    com.alibaba.dubbo.remoting.ExecutionException: class com.alibaba.dubbo.remoting.transport.dispatcher.all.AllChannelHandler error when process caught event .
            at com.alibaba.dubbo.remoting.transport.dispatcher.all.AllChannelHandler.caught(AllChannelHandler.java:67) ~[dubbo-2.5.3.jar:2.5.3]
    p

    二、问题分析

    项目的实际配置:

    <dubbo:provider timeout="50000" threadpool="fixed" threads="500" accepts="1000" />

    timeout="5000":设置远程调用服务的超时时间为5000毫秒
    threadpool="fixed":线程模型为固定大小的线程池,启动时建立线程,不关闭,一直持有
    threads="500":线程数为500
    accepts="1000":限制服务器端的接受的连接的最大值为1000

    再看看dubbo官网上的线程模型的内容


    • Dispatcher
      • all 所有消息都派发到线程池,包括请求,响应,连接事件,断开事件,心跳等。
      • direct 所有消息都不派发到线程池,全部在IO线程上直接执行。
      • message 只有请求响应消息派发到线程池,其它连接断开事件,心跳等消息,直接在IO线程上执行。
      • execution 只请求消息派发到线程池,不含响应,响应和其它连接断开事件,心跳等消息,直接在IO线程上执行。
      • connection 在IO线程上,将连接断开事件放入队列,有序逐个执行,其它消息派发到线程池。
    • ThreadPool
      • fixed 固定大小线程池,启动时建立线程,不关闭,一直持有。(缺省)
      • cached 缓存线程池,空闲一分钟自动删除,需要时重建。
      • limited 可伸缩线程池,但池中的线程数只会增长不会收缩。(为避免收缩时突然来了大流量引起的性能问题)。

    配置如:

    <dubbo:protocolname="dubbo"dispatcher="all"threadpool="fixed"threads="100"/>

    配置标签

    <dubbo:provider/>

    <dubbo:protocol/>

    例:

    <!-- 当ProtocolConfig和ServiceConfig某属性没有配置时,采用此缺省值 -->
    <dubbo:provider timeout="10000" threadpool="fixed" threads="100" accepts="1000" />

    <dubbo:protocol/>

  • 相关阅读:
    js 改变颜色值
    React之使用Context跨组件树传递数据
    App.js实现使用js开发app的应用,此文是中文文档
    转: CSS3 @media 用法总结
    转: 如何用手机访问电脑本地 localhost 网页或者服务器, 以调试web项目
    js 替换字符串中所有匹配的字符
    转:display:flex不兼容Android、Safari低版本的解决方案 【flex布局】
    转:HTML5页面如何在手机端浏览器调用相机、相册功能
    文本相似度度量
    idea中maven中jdk版本的选择(转)
  • 原文地址:https://www.cnblogs.com/xmanblue/p/5973564.html
Copyright © 2011-2022 走看看