使用arthas反编译检查线上环境的nio网络模型是否是epoll

-bash-3.2$ java -jar arthas-boot.jar 
[INFO] arthas-boot version: 3.4.5
[INFO] Process 14308 already using port 3658
[INFO] Process 14308 already using port 8563
[INFO] Found existing java process, please choose one and input the serial number of the process, eg : 1. Then hit ENTER.
* [1]: 14308 com.xxx.netty.NettyServer
  [2]: 14224 org.jetbrains.idea.maven.server.RemoteMavenServer
  [3]: 14307 org.jetbrains.jps.cmdline.Launcher
  [4]: 744 
  [5]: 1534 com.tsf.demo.provider.ProviderApplication
1
[INFO] arthas home: /Users/lu-tsang/.arthas/lib/3.5.3/arthas
[INFO] The target process already listen port 3658, skip attach.
[INFO] arthas-client connect 127.0.0.1 3658
  ,---.  ,------. ,--------.,--.  ,--.  ,---.   ,---.                           
 /  O  \ |  .--. ''--.  .--'|  '--'  | /  O  \ '   .-'                          
|  .-.  ||  '--'.'   |  |   |  .--.  ||  .-.  |`.  `-.                          
|  | |  ||  |\  \    |  |   |  |  |  ||  | |  |.-'    |                         
`--' `--'`--' '--'   `--'   `--'  `--'`--' `--'`-----'                          
                                                                                

wiki       https://arthas.aliyun.com/doc                                        
tutorials  https://arthas.aliyun.com/doc/arthas-tutorials.html                  
version    3.5.3                                                                
main_class com.xxx.netty.NettyServer                                        
pid        14308                                                                
time       2021-08-06 10:44:12                                                  

[arthas@14308]$ 

笔者用的macos所以是KQueueSelectorImpl,如果是linux系统对应的selector是EPollSelectorImpl

[arthas@14308]$ jad sun.nio.ch.DefaultSelectorProvider

ClassLoader:                                                                    

Location:                                                                       
                                                                                

       /*
        * Decompiled with CFR.
        */
       package sun.nio.ch;
       
       import java.nio.channels.spi.SelectorProvider;
       import sun.nio.ch.KQueueSelectorProvider;
       
       public class DefaultSelectorProvider {
           private DefaultSelectorProvider() {
           }
       
           public static SelectorProvider create() {
               return new KQueueSelectorProvider();
           }
       }

Affect(row-cnt:1) cost in 138 ms.
[arthas@14308]$ jad sun.nio.ch.KQueueSelectorProvider

ClassLoader:                                                                    

Location:                                                                       
                                                                                

       /*
        * Decompiled with CFR.
        */
       package sun.nio.ch;
       
       import java.io.IOException;
       import java.nio.channels.spi.AbstractSelector;
       import sun.nio.ch.KQueueSelectorImpl;
       import sun.nio.ch.SelectorProviderImpl;
       
       public class KQueueSelectorProvider
       extends SelectorProviderImpl {
           @Override
           public AbstractSelector openSelector() throws IOException {
               return new KQueueSelectorImpl(this);
           }
       }

Affect(row-cnt:1) cost in 123 ms.
[arthas@14308]$ 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值