`

Weblogic Muxer Thread

 
阅读更多

1         Weblogic Muxer Socket Thread

 
Weblogic has Thread group called ‘Weblogic Muxer’, once you take thread dumps you could see always 4-8 running Muxer Threads e.g. ExecuteThread: '3' for queue: 'weblogic.socket.Muxer
Muxer threads plays very important role when your Production environment struggling with performance problems.
In this article I just want to give some insight about Muxer threads which I gained from my own experience in my current project. 
 

1.1       What is Muxer Threads:

 
Muxer thread is software components which weblogic uses to read/write the data from the socket on which external system communicating, once Muxer thread reads data from socket its pass on that message to Weblogic Execute queue and from there Weblogic Self Tunning Thread pool threads pick the message and process the request.
You can unable/disable “Enable Native IO” option from Admin console for a specific servers –
 
 

1.2       Types of Muxer Threads-

 
There are three types of Muxer threads –
 

1.2.1     Native Muxers

Native muxers use platform-specific native binaries to read data from sockets. The majority of all platforms provide some mechanism to poll a socket for data. For example, Unix systems use the poll system call and the Windows architecture uses completion ports. Native muxers provide superior scalability because they implement a non-blocking thread model. When a native muxer is used, the server creates a fixed number of threads dedicated to reading incoming requests. Oracle recommends using the default setting of true for the Enable Native IO parameter which allows the server to automatically select the appropriate muxer to use.

Configuration:
Checked "Enable Native IO" only from Admin console.
 
Count Of Muxer Threads:
4
 
Stack Trace from Thread Dump:
"ExecuteThread: '2' for queue: 'weblogic.socket.Muxer'" daemon prio=3 tid=0x00000001042f4800 nid=0x1e waiting for monitor entry [0xffffffff5e6ff000]
   java.lang.Thread.State: BLOCKED (on object monitor)
                at weblogic.socket.DevPollSocketMuxer.processSockets(DevPollSocketMuxer.java:92)
                - waiting to lock <0xfffffffe20485978> (a java.lang.String)
                at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
                at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:42)
                at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
                at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
 
Comment/Remark:
In this case Weblogic will use native class "DevPollSocketMuxer" for Sun hardware.
 

1.2.2     Java Muxer

A Java muxer has the following characteristics:

·         Uses pure Java to read data from sockets.
·         It is also the only muxer available for RMI clients.
·         Blocks on reads until there is data to be read from a socket. This behavior does not scale well when there are a large number of sockets and/or when data arrives infrequently at sockets. This is typically not an issue for clients, but it can create a huge bottleneck for a server.

If the Enable Native IO parameter is not selected, the server instance exclusively uses the Java muxer. This maybe acceptable if there are a small number of clients and the rate at which requests arrive at the server is fairly high. Under these conditions, the Java muxer performs as well as a native muxer and eliminate Java Native Interface (JNI) overhead. Unlike native muxers, the number of threads used to read requests is not fixed and is tunable for Java muxers by configuring the Percent Socket Readers parameter setting in the Administration Console. Ideally, you should configure this parameter so the number of threads roughly equals the number of remote concurrently connected clients up to 50% of the total thread pool size. Each thread waits for a fixed amount of time for data to become available at a socket. If no data arrives, the thread moves to the next socket.

 
Configuration:
1) UnChecked "Enable Native IO" option from Admin Console
2) Removed"-Dweblogic.MuxerClass=weblogic.socket.NIOSocketMuxer" if exist in setDomainEnv.sh or at Admin server consolehttp://docs.oracle.com/cd/E24329_01/apirefs.1211/e24401/taskhelp/tuning/EnableNIOSocketMuxer.html
 
Count Of Muxer Threads:
4
 
Stack Trace from Thread Dump:
"[ACTIVE] ExecuteThread: '16' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=3 tid=0x00000001035fb800 nid=0x2c runnable [0xffffffff6a5fe000]
   java.lang.Thread.State: RUNNABLE
 at java.net.SocketInputStream.socketRead0(Native Method)
 at java.net.SocketInputStream.read(SocketInputStream.java:129)
 at weblogic.socket.SocketMuxer.readFromSocket(SocketMuxer.java:988)
 at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:922)
 at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:889)
 at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:339)
 at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:252)
 at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
 
Comment/Remark:
Weblogic using JAVA Muxer class to read/write the data from sockets.

1.2.3     Non-Blocking IO Muxer

WebLogic Server provides a non-blocking IO implementation that may provide enhanced performance for some applications
To enable non-blocking IO:

  1. If you have not already done so, in the Change Center of the Administration Console, click Lock & Edit (see Use the Change Center).
  2. In the left pane of the console, expand Environment > Servers.
  3. On the Summary of Servers page, select the server instance for which you will enable native IO.
  4. Expand the Configuration > Tuning tab.
  5. If necessary, click Advanced to access advanced tuning parameters.
  6. Enter weblogic.socket.NIOSocketMuxer in the Muxer Class field.
  7. Click Save.
  8. To activate these changes, in the Change Center of the Administration Console, click Activate Changes. 
    Not all changes take effect immediately—some require a restart
Configuration:
1)      Checked "Enable Native IO" option from Admin console.
2)       Added "-Dweblogic.MuxerClass=weblogic.socket.NIOSocketMuxer" in setDomainEnv.sh to override the Muxer class.
 
Count Of Muxer Threads: 4
 
Stack Trace from Thread Dump:
"ExecuteThread: '3' for queue: 'weblogic.socket.Muxer'" daemon prio=3 tid=0x000000010360f800 nid=0x31 runnable [0xffffffff5c2ff000]
   java.lang.Thread.State: RUNNABLE
        at sun.nio.ch.DevPollArrayWrapper.poll0(Native Method)
        at sun.nio.ch.DevPollArrayWrapper.poll(DevPollArrayWrapper.java:171)
        at sun.nio.ch.DevPollSelectorImpl.doSelect(DevPollSelectorImpl.java:84)
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87)
        - locked <0xfffffffe23f121d8> (a sun.nio.ch.Util$2)
        - locked <0xfffffffe23f121c8> (a java.util.Collections$UnmodifiableSet)
        - locked <0xfffffffe23ebc5b8> (a sun.nio.ch.DevPollSelectorImpl)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:102)
        at weblogic.socket.NIOSocketMuxer.processSockets(NIOSocketMuxer.java:320)
 
        at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
        at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:42)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
 
 
Comment/Remark:

This time since we explicitly gave Muxerclass name at JVM level it’s using now "NIOSocketMuxer" class for socket reading.

Snap from Thread dump -


Refer the below URL for details understanding-

 

1.3       Error Related to Socket Problems –

 
In Weblogic .out log file you might see lots of IO Exception and Socket Exception mentioned below
<Nov 16, 2012 12:42:28 PM EST> <Error> <WliSbTransports> <BEA-381304> <Exception in HttpInboundMessageContext.close: java.io.IOException: Broken pipe
java.io.IOException: Broken pipe
        at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
        at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
        at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:89)
        at sun.nio.ch.IOUtil.write(IOUtil.java:60)
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:450)
        Truncated. see log file for complete stacktrace
 
<Dec 6, 2012 1:58:11 AM EST> <Error> <WliSbTransports> <BEA-381304> <Exception in HttpOutboundMessageContext.RetrieveHttpResponseWork.run: java.io.IOException: Connection reset by peer
java.io.IOException: Connection reset by peer
                at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
                at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
                at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:218)
                at sun.nio.ch.IOUtil.read(IOUtil.java:191)
                at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:359)
                Truncated. see log file for complete stacktrace

1.4       General Question which rises in Mind in regard to Socket Configuration

 
Question1: If the configuration contains checked “Enable Native IO” and “-Dweblogic.SocketReaders=8
-Dweblogic.MuxerClass=weblogic.socket.NIOSocketMuxer”
In that case will weblogic uses native IO or non native IO.
 
Ans:  Above configuration will override default configuration and will use weblogic.socket.NIOSocketMuxer class which is Non blocking class been added later to provide improved performance. Refer this doc for details
 
http://docs.oracle.com/cd/E24329_01/web.1211/e24390/wls_tuning.htm#i1151673
 
Question2:  Can we use both Native IO and JAVA IO socket threads together?
 
Ans: no we can have only one sort of implementation, though your server configuration can have two configurations but one must be suppressed by another configuration.
 
Question3 : If we use Socket Reader count up to 8 using this configuration “Dweblogic.SocketReaders=8”, what will happen if we disabled the “Enable Native IO” Option, Will weblogic by default allow to use 33% of Execute Threads as Socket Reader threads?
 
Ans:  No, again default configuration will be override, weblogic will use 8 Muxer thread only to do socked read/write.
 
Question4: Which one out of Native IO and JAVA IO socket threads we should use in Production with high traffic volume?
 
Ans:
In our production previously we were having checked “Enable Native IO” and specified “NIOMuxerclass” and were facing many problem e.g. OSB transaction were hanging, were not getting timeout, socket timeout exception was coming in logs, later point of time as per Oracle recommendation we switch back to default Weblogic configuration which checked “Enabled Native IO”, removed NIOMuxer class and after that we witnessed lot more improvement in Production environment.
 
Question: What should be no of socket reader threads?
 
Ans:  We have tested various configuration in our Test environment and found that weblogic by default mostly use 4 Muxer threads only regardless of Native or Non Native Muxer Type. For Java Muxer document says it can use 33% threads from Execute Thread groups but we realized even with that configuration in 30 TPS load Weblogic initializing only 4 threads.

2         Summary:

As per my experience I would always suggest to go with default configuration which comes with Weblogic for Socket Reader Muxer threads, previously we have modified the configuration and introduced NIO Muxer class and also increased no of socket Reader threads but it didn’t help for any performance, even we notice lots of strange behaviour start occurring, later point of time we switch back to Default Weblogic Configuration and realized improvement. So go with default configuration. Also when you look at Thread dumps you might see Muxer Thread for Block state for longer time etc so don't be scared for that, Muxer threads are designed in such way only, its normal to see Muxer Thread Blocked state till long time.
分享到:
评论

相关推荐

    weblogic thread dump 分析

    python 脚本从nohup.out ibm core 文件 ,或者从weblogic 的console 里面 thread dump 整理出来,统一格式便于查看,适合于性能分析

    weblogic监控 weblogic调优 weblogic版本区别 weblogic启动关闭脚本

    WebLogic Server是一款由Oracle公司开发的企业级Java应用服务器,它为构建、部署和管理企业级Java应用程序提供了全面的平台。本文将深入探讨WebLogic的监控、调优、不同版本之间的区别以及启动和关闭脚本的使用。 ...

    weblogic10.3.3之后版本升级至weblogic10.3.6文档.docx

    ### WebLogic 10.3.3 至 10.3.6 升级指南 #### 一、概述 本指南旨在详细介绍如何从WebLogic Server 10.3.3及其后续版本升级到10.3.6版本的具体步骤。升级过程中需要考虑的因素以及必要的准备措施也将被涵盖。 ###...

    Weblogic 套件和Weblogic 标准版 Weblogic 企业版 功能对比

    在IT领域,特别是针对企业级应用服务器的选择与配置,Oracle WebLogic Server无疑占据了重要的位置。WebLogic Server作为一款高性能、可扩展的企业级Java应用服务器,提供了丰富的功能与服务,适用于构建、部署和...

    weblogic详细安装部署手册

    ### WebLogic详细安装部署流程 #### 一、安装前准备 **1.1 JDK环境配置** - **确保JDK已安装:** 在安装WebLogic之前,必须先安装Java Development Kit (JDK)。WebLogic服务器依赖于JDK来运行。请确保安装的是与...

    eclipse的weblogic插件

    为了在Eclipse中方便地开发、调试和管理运行在WebLogic上的应用,Eclipse提供了WebLogic插件。 WebLogic插件的安装方法如描述所述,首先需要将下载的WebLogic插件压缩包解压。这个压缩包通常包含了若干个.jar文件,...

    WebLogic宕机大全总结

    - **收集Thread Dump**:每隔一段时间收集Thread Dump信息,以便进一步分析线程的状态和行为。 #### 五、线程队列原理 WebLogic Server内部使用了多种线程队列来处理不同的任务类型,其中包括: - **Weblogic.admin...

    weblogic weblogic weblogic

    WebLogic是Oracle公司的一款企业级Java应用服务器,它基于Java EE(Enterprise Edition)平台,用于构建、部署和管理分布式应用程序。WebLogic Server是许多大型企业和组织的核心组件,它提供了多种功能和服务,包括...

    weblogic10.3性能优化参数配置

    Weblogic 10.3 性能优化参数配置 Weblogic 服务器是 Oracle 公司推出的一个基于 Java 的中间件服务器,广泛应用于企业级应用系统中。为了确保 Weblogic 服务器的高性能和稳定运行,需要对其进行合理的配置和优化。...

    weblogic傻瓜式安装教程

    ### WebLogic傻瓜式安装教程详解 #### 一、前言 本文档旨在提供一个简单易懂的WebLogic安装教程,适用于初次接触WebLogic或希望快速完成安装的用户。通过本教程,您将学会如何在Linux环境下进行WebLogic的安装与...

    weblogic日常巡检,问题排查

    ### WebLogic 日常巡检与问题排查 #### 引言 WebLogic作为一款广泛使用的Java应用服务器,在企业级应用环境中扮演着重要的角色。为了确保WebLogic服务器能够稳定、高效地运行,定期进行健康检查(巡检)是非常必要...

    weblogic&java精华

    WebLogic&Java精华 weblogic&java精华java weblogic 面试题 下面是根据提供的文件信息生成的相关知识点: Java基础 1. Java 基础知识 在 Java 中,加载和启动 Servlet 后,为一个 Servlet 创建了一个还是多个...

    weblogic 开机自动启动

    Weblogic 开机自动启动详解 Weblogic 作为一个流行的 Java 企业级应用服务器,通常需要在服务器启动时自动启动,以确保业务的连续性。然而,在 Windows 系统下,Weblogic 的自动启动却需要进行一些额外的配置。在这...

    Linux环境Weblogic超详细安装配置文档

    Linux 环境 Weblogic 超详细安装配置文档 Weblogic 的安装 Weblogic 的安装过程可以分为两部分:Linux 下安装过程和 Windows 中安装过程。下面是 Linux 下安装过程的详细步骤: 1. 部署前准备:创建 weblogic ...

    WebLogic创建根上下文

    ### WebLogic创建根上下文知识点解析 #### 一、WebLogic服务器简介 WebLogic Server是Oracle公司提供的一个应用服务器,主要用于构建和部署企业级应用程序。它支持Java EE标准,并提供了高性能、高可用性和可伸缩性...

    weblogic12.1.3补丁包

    WebLogic Server是Oracle公司的一款企业级Java应用服务器,它提供了用于构建、部署和管理分布式Java应用程序和服务的平台。WebLogic 12.1.3版本是该产品的一个重要更新,包含了许多性能优化、新功能以及安全修复。在...

    WebLogic License

    WebLogic License是Oracle WebLogic Server的关键组成部分,它定义了用户可以如何使用和部署这款企业级应用服务器。在Oracle收购BEA之后,WebLogic License的管理方式发生了一些变化,旨在简化授权流程并提供更大的...

    weblogic设置session超时时间

    WebLogic 设置 Session 超时时间 WebLogic 是一个功能强大且流行的 Java 企业级应用服务器,支持多种方式来设置 Session 的超时时间。在本文中,我们将介绍如何在 WebLogic 中设置 Session 超时时间。 Method 1: ...

    Weblogic提高并发处理性能的设置

    - 修改“线程池大小”(ThreadCount)为一个较大的值,例如100。 - 保存更改并重启服务器。 在调整线程数时需要注意以下几点: - 过多的线程会导致CPU和内存资源消耗增大,因此需要根据实际硬件配置进行合理设置...

    weblogic和MyEclipse集成配置

    【WebLogic和MyEclipse集成配置详解】 WebLogic是Oracle公司的一款企业级应用服务器,而MyEclipse是一款强大的Java集成开发环境,特别适合于开发和部署Java EE应用程序。将两者集成可以方便地在MyEclipse中管理和...

Global site tag (gtag.js) - Google Analytics