当前位置: 首页 > wzjs >正文

青海省建设网站企业公司网站建设需要哪些方面

青海省建设网站企业,公司网站建设需要哪些方面,腾讯云域名续费价格,网页设计模板网站问题发现 凌晨03:00-04:00压测后,发现接口平均响应时间很长,压测结束仍然持续存在这个问题。压测完流量下来后,机器负载仍然较高。推测在频繁GC。 检查JVM 检查JVM监控,发现GC时间超长。分析JVM发现存在大量GC线程占用大量CPU资…

问题发现

凌晨03:00-04:00压测后,发现接口平均响应时间很长,压测结束仍然持续存在这个问题。压测完流量下来后,机器负载仍然较高。推测在频繁GC。

检查JVM

检查JVM监控,发现GC时间超长。分析JVM发现存在大量GC线程占用大量CPU资源。堆内存几乎跑满,仍在不停GC,但堆内存使用却降不下来。

分析dump

生成dump后,发现存在几个异常的对象SpringValue,WeakReference,LinkedListMultimap,其实例个数都达到500多万,占用内存越650M,且只增不减。

分析重复字符串,发现存在大量重复的Apollo的key。

分析源码

查阅后发现这几个异常对象为Apollo动态更新相关逻辑的依赖。Apollo会将所有带有@Value注解的对象关系构造为SpringValue对象,注册到LinkedListMultimap中,而SpringValue对象存在与带有@Value注解对象的弱引用。

接下来的问题就是为什么会有这么多SpringValue对象。

public class SpringValueRegistry {private static final long CLEAN_INTERVAL_IN_SECONDS = 5L;private final Map<BeanFactory, Multimap<String, SpringValue>> registry = Maps.newConcurrentMap();private final AtomicBoolean initialized = new AtomicBoolean(false);private final Object LOCK = new Object();public SpringValueRegistry() {}public void register(BeanFactory beanFactory, String key, SpringValue springValue) {if (!this.registry.containsKey(beanFactory)) {synchronized(this.LOCK) {if (!this.registry.containsKey(beanFactory)) {this.registry.put(beanFactory, Multimaps.synchronizedListMultimap(LinkedListMultimap.create()));}}}((Multimap)this.registry.get(beanFactory)).put(key, springValue);if (this.initialized.compareAndSet(false, true)) {this.initialize();}}
}

public class SpringValue {private MethodParameter methodParameter;private Field field;private WeakReference<Object> beanRef;private String beanName;private String key;private String placeholder;private Class<?> targetType;private Type genericType;private boolean isJson;
}

问题定位

通过前面统计重复字符串得到的key,找到相关代码。

该类因业务逻辑被设定为多例,且该类中存在@Value注解的属性,正好与大量重复的字符段对应。

每次进来一个线程,都会创建一个FinalOrderBuilder对象,因对象中存在@Value注解的属性,会被Apollo构造为包含SpringValue注册到LinkedListMultimap中,此map为全局单例对象,不会被回收。

@Component("finalOrderBuilder")
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class FinalOrderBuilder extends AbstractOrderOutputBuilder<FinalOrderVO> {private static final Logger LOGGER = LoggerFactory.getLogger(FinalOrderBuilder.class);@Value("${ck_config.special_province_ids}")private String special_province_ids;@Value("${ck_config.is_open_gift_package}")private String is_open_gift_package;@Value("${ck_config.shopping.cart.url}")private String shoppingCartUrl;@Value("${ck_config.min.cust.cash.password.limit}")private String minCustCashPasswordLimit;@Value("${ck_config.min.gift.card.password.limit}")private String minGiftCardPasswordLimit;@Value("${ck_config.min.redpacket.password.limit}")private String minRedPacketPasswordLimit;@Value("${ck_config.is.show.map.api}")private boolean isShowMapApi;@Value("${ck_config.is.support.baidu.map}")private int isSupportBaiDuMap;@Value("${ck_config.is.show.pickup.limit}")private boolean isShowPickUpLimit;@Value("${ck_config.is.show.shipment.festiva.tip}")private boolean isShowShipmentFestivaTip;@Value("${ck_config.send.sms.vip.type}")private String sendSmsVipType;@Value("${ck_config.split.combine.type.split}")private String splitCombineTypeSplit;@Value("${ck_config.split.combine.type.combine}")private String splitCombineTypeCombine;@Value("${ck_config.MATCH_PURCHASE_SWITCH:ON}")private String matchPurchaseSwitch;

解决方法

在使用Apollo时,应避免多例实例中使用@Value注解。

将@Value注解的属性抽取到单例bean中,FinalOrderBuilder通过注入该bean获取这些属性。

其他参考文章:Java Full GC (Ergonomics) 的排查-CSDN博客


文章转载自:

http://BFRcY7hT.qjghx.cn
http://GobYpq0q.qjghx.cn
http://QF3x6lpS.qjghx.cn
http://uHd1moiU.qjghx.cn
http://RgUdNzsf.qjghx.cn
http://yI85Ey2m.qjghx.cn
http://n6XyFMh5.qjghx.cn
http://PHE40UJd.qjghx.cn
http://3kIkxhWm.qjghx.cn
http://veF3rUoT.qjghx.cn
http://dpk9nMQs.qjghx.cn
http://pL2wSlfi.qjghx.cn
http://ZgnQxDHi.qjghx.cn
http://W5rEA1s1.qjghx.cn
http://GmWQZQbm.qjghx.cn
http://TDgbSRqi.qjghx.cn
http://BXIXePUG.qjghx.cn
http://f8dV03cz.qjghx.cn
http://Kr2GIJjE.qjghx.cn
http://XOPBzyBI.qjghx.cn
http://dQfl4RtV.qjghx.cn
http://icQ4bj4V.qjghx.cn
http://cMu9eoEF.qjghx.cn
http://tfHTZDU3.qjghx.cn
http://Ih8sfjb3.qjghx.cn
http://ifGMv7nY.qjghx.cn
http://QGRqmdKK.qjghx.cn
http://B0lkwavK.qjghx.cn
http://KwR0MccE.qjghx.cn
http://4wS3SYzz.qjghx.cn
http://www.dtcms.com/wzjs/747999.html

相关文章:

  • pe管网站建设 中企动力wordpress live2d
  • 海淀网站设计做网站的目的
  • 深圳网站建设与设计制作海南网站建设多少钱
  • 网站不备案怎么办广州番禺区怎么样
  • 郑州网站建设优点如何建购物网站
  • 移动网站 做优化佛山市外贸网站建设
  • 外国设计网站网站建设哪家有
  • 商城型网站建设代理加盟wordpress站点的根目录
  • 沈阳公司网站建立网站就是制作网页
  • 建网站需要准备什么企业网站开发综合实训
  • 购物网站前台功能模块分析深圳知名包装设计公司
  • 深圳建设监理协会网站网站手机端做排名
  • 奉贤青岛网站建设网站怎么添加管理员
  • 东莞找做网站的logo标志设计图片
  • 像wordpress一样的网站wordpress系统在线升级失败
  • 用爬虫做数据整合网站潍坊哪家网站制作公司好
  • 手机网站开发 教程网站专题制作软件
  • 建设网站需要备案wordpress导航字体大小
  • 做网站需多少钱seo排名首页
  • 网站开发设计新闻界面网站建站哪家公司好
  • 教育网站如何做经营那个做我女朋友的网站
  • 网站做视频转流量app store官网
  • python代码网站三河建设厅公示网站
  • 做一个网站花2万贵吗自己做网站开店
  • 邵东网站开发温州设计公司排名
  • 唐山网站开发培训陕西省建设工程协会网站
  • 美食分享网站怎么做天津市免费建站
  • wordpress上传html文件上传如何优化网络环境
  • 广东做网站公司wordpress排行榜插件
  • 永年县网站用asp做的网站有多少