6到飞起Arthas——记一次线上问题排查及调优

ConcurrentHashMap 原理与高并发实战:从分段锁到CAS锁桶 ConcurrentHashMap 是 Java 并发编程中支撑高吞吐 Map 操作的核心数据结构,其本质是通过细粒度锁机制(如分段锁、CAS + synchronized 锁单桶)在保证线程安全的前提下极大提升并发读写性能。它基于 volatile 可见性、无锁读设计、协作式扩容等底层原理,实现了远超 Hashtable 和 SynchronizedMap 的吞吐能力。技术价值在于平衡一致性与性能,适用于缓存计数、会话管理、实时指标聚合等典型高并发场景。本文深入剖析 JDK 1.5 至 1.9 的演进逻辑 阅读详情

Arthas 是Alibaba开源的Java诊断工具,通过Java agent机制 attach到ava进程上,使用ASM技术对需要诊断的类进行字节码修改。(详细原理及用法参照官方文档https://arthas.aliyun.com/doc/en/)

线上诊断神器Arthas,强烈安利一波。好嘞,切回本次重点,记一次线上调优:

背景:

  公司自研的服务治理框架,sdk客户端在向控制中心寻址时,经常会出现寻址超时的情况(sdk客户端设置超时时间为3s)。虽然客户端会每5S会发送一次寻址请求,且请求到的数据会放入缓存中,如果请求失败,只是不会更新缓存。

因为只要在一定的时间内有一次寻址成功,sdk中就会缓存A应用依赖的其它服务的实例信息,在A应用需要调用其它服务时,是直接使用sdk缓存中的其它服务的实例信息进行负载均衡的。所以通常情况下不太会影响业务,但是这样依旧会存在很多问题:比如A依赖的服务的实例有变化(新增节点、删除节点、心跳上传失败、上下负载等等),客户端寻址超时,将无法更新缓存,sdk中的实例信息依旧是旧的,负载时可能会将流量打入到实际上已经不存活的节点上、或者无法将流量打入新增的节点上。。。这是很可怕的!!!

如图可以看到很多最大执行时间超过了3s:

 

服务注册和服务寻址作为服务治理框架最基本的功能,我们都无法给用户有力的保证,那岂不是很离谱。所以针对出现的寻址超时问题,进行了一次深入的问题排查。

---------------------------

前期种种问题排查、定位、代码逻辑梳理等工作不做赘述

Listener加载顺序暗坑:我的初始化代码“人间蒸发”,测试妹子第5次站我工位前… 摘要:本文记录了作者在Tomcat9.0.85环境下排查"系统配置缺失"问题的全过程。问题表现为预发环境间歇性出现NullPointerException,而本地运行正常。通过日志埋点、Arthas监控和Tomcat源码分析,发现根本原因是ServletContextListener执行顺序问题:Tomcat按web.xml声明顺序逆序执行Listener,导致后执行的Spring ContextLoaderListener清除了先执行的SystemConfigLoader设置的属性。最 阅读详情

相关推荐

Java矩阵编程实战:从内存布局到生产级优化

矩阵运算是线性代数在工程中的核心落地形式,本质是基于内存连续性的高效数值计算。其性能瓶颈70%源于JVM内存模型与CPU缓存行为的错配,而非算法复杂度;Java类型擦除、堆内/堆外内存管理、浮点精度漂移等特性进一步加剧实现难度。掌握一维数组内存对齐、CSR稀疏存储、ZGC大对象回收及JNI BLAS桥接等关键技术,可显著提升科学计算、机器学习接口封装与实时图形渲染等场景的稳定性与吞吐。本文聚焦Matrix Programs in Java这一高频但易被低估的工程能力,提供从零构建高性能矩阵库的完整路径。

weixin_33831673的博客 350

SAP MM采购合同创建全解析:ME31K操作与后台逻辑

在SAP ERP的物料管理模块中,采购合同作为框架协议的核心,定义了企业与供应商之间的长期供货关系。它与采购订单不同,合同不直接产生收货或发票,而是为后续采购订单提供数据源。创建合同(事务码ME31K)时,需要区分数量合同与金额合同,并维护抬头、行项目、有效期、价格条件和税码等关键信息。SAP通过源确定机制在创建采购订单时自动匹配合同,同时审批策略、编码范围和输出类型也会影响合同的实际可用性。掌握合同创建逻辑,能有效解决采购订单无法带出合同、审批未触发、价格缺失等高频问题。从ME31K实操出发,系统梳理采购

weixin_30000735的博客 207

Lumerical FDTD新手必看:从零开始搭建光子晶体仿真环境(附完整脚本)

本文为Lumerical FDTD新手提供光子晶体仿真环境的完整搭建指南,涵盖从基础参数设置到脚本编写的全流程。通过典型光子晶体带隙分析案例,详细讲解结构建模、仿真参数配置及后处理技巧,并附赠完整MATLAB脚本,帮助用户快速掌握FDTD仿真核心技术。

3c4x5z6v7b的博客 1058

thinkcmf 代码执行 (CVE-2019-7580) 漏洞复现

所有文章,仅供安全研究与学习之用,后果自负! thinkcmf 代码执行 CVE-2019-7580thinkcmf 代码执行 (CVE-2019-7580)0x01 漏洞描述0x02 影响范围0x03 漏洞复现3.1 登录后台3.2 漏洞利用3.2.1webshell3.2 phpinfo3.3 获取系统命令0x04 漏洞修复 thinkcmf 代码执行 (CVE-2019-7580) 复现小心会搞崩环境。 0x01 漏洞描述 ThinkCMF是一款支持Swoole的开源内容管理框架(CMF),基于Thi

YouthBelief的博客 4271

@transactional滥用导致数据源连接池耗尽问题

@transactional滥用导致数据源连接池耗尽问题

qq_43205267的博客 1203

药物对接仿真软件:HADDOCK_(16).实践项目:抗体-抗原对接案例

定义分子结构文件。

kkchenjj的博客 586

uniapp [安卓苹果App端] - 实现集成微信一键登录及授权获取用户信息全流程源码,uniApp唤起微信客户端app实现微信授权头像昵称手机号(提供移动应用/开放平台/资质认证/签名/权限申请

uni-app,安卓Android,苹果ios,安卓app端,苹果App端,uniapp苹果安卓app,微信一键登录,uniapp项目App端实现微信登录,Uniapp实现微信授权登录,调起微信客户端授权用户信息,uniappapp端微信一键登录打开手机微信app,app端如何唤起用户本机微信应用并授权登陆,如何申请微信一键登录,uniapp实现APP微信登录流程,打开本地微信软件,接入微信登录,UniApp实现微信登录教程,获取头像昵称手机号用户数据,超详细实现微信登录功能,唤起没反应,授权失败,获取

🏆 前端领域优质创作者 1万+

innovus:Clock Gating Check设置与报告

看图后发现,在设置clock gating check之前报告也会有clock gating check的值,这个就是因为timing library中会像reg一样定 library setup time值,如下图。我们常用set_clock_gating_check -setup去过约束Place阶段reg2cgate的时序,以防CTS后由于tree不平导致的时序违例。我正在「拾陆楼」和朋友们讨论有趣的话题,你⼀起来吧?

m0_61544122的博客 1028

华为OD机试双机位C卷-简单的解压缩算法(C/C++/Py/Java/Js/Go)

华为OD机试(机考)双机位C卷 【简单的解压缩算法】,提供C语言、Java、C++、Python、Go、JavaScript源码实现,并提供完整思路讲解,以及在线OJ模拟做题。华为OD真题【简单的解压缩算法】。

qq_45776114的博客 483

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

上一篇: 分布式系统之副本一致性
下一篇: 线上OOM故障排查——Curator retryPolicy的选择、Jute.maxBuffer的配置
学徒菠仔
博客等级 码龄9年 4粉丝 4原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值