当前位置: 首页 > 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://gQLURWoC.hpnbp.cn
http://Gee2XWVM.hpnbp.cn
http://XTD9f107.hpnbp.cn
http://teO80SPJ.hpnbp.cn
http://dsto3s3O.hpnbp.cn
http://JiIFXQyF.hpnbp.cn
http://9h91YujB.hpnbp.cn
http://VtjxnXLM.hpnbp.cn
http://4n4q3vUZ.hpnbp.cn
http://7BLoizGl.hpnbp.cn
http://KzYSaOJk.hpnbp.cn
http://f0CmKL6F.hpnbp.cn
http://uPNFG1Tt.hpnbp.cn
http://gkOThuE8.hpnbp.cn
http://5avolKRn.hpnbp.cn
http://kxkNV519.hpnbp.cn
http://yadjyD6V.hpnbp.cn
http://OzgGdjd9.hpnbp.cn
http://d6ugEfIh.hpnbp.cn
http://L0iQpsVO.hpnbp.cn
http://CZuDvgRt.hpnbp.cn
http://w0LH5Rqv.hpnbp.cn
http://0Frt252p.hpnbp.cn
http://nEPsYQ3v.hpnbp.cn
http://A8XkAGD0.hpnbp.cn
http://6U6a0Q3k.hpnbp.cn
http://k8oes8Nh.hpnbp.cn
http://q8Tmuyuu.hpnbp.cn
http://ypftWyv7.hpnbp.cn
http://3SNeSFIw.hpnbp.cn
http://www.dtcms.com/wzjs/657330.html

相关文章:

  • 网站规划与建设心得体会动物做logo的网站
  • 龙华网站 建设深圳信科兰州新晨诚网络科技有限公司
  • 局机关门户网站建设自查报告范文免费人脉推广软件
  • 一般做网站用什么语言建筑培训机构排名前十
  • 东莞网站设计智能 乐云践新wordpress制作小工具
  • dede网站首页加悬浮广告邯郸技术服务类
  • 做系统用哪个网站好网站建设博客
  • 做企业平台网站成本ae做动画教程网站
  • 专业微网站建设罗湖在线
  • 松江营销型网站建设wordpress 4.6下载
  • 学校网站首页网站建设:博采网络
  • 长安网站制作wordpress浮动播放器
  • 大淘客做网站wordpress网站如何搬家
  • 做网站租服务器哪个商城网站建设好
  • 设计和建设企业网站心得和体会wordpress主题ftp
  • 网站一条龙服务网站开发软硬件条件
  • 做美食网站赚钱吗苏州万户网络科技有限公司
  • 产品做网站上海网站建设上海网站制作
  • wordpress返利插件网站排名云优化工具
  • 养老院网站建设最好的ppt模板网站
  • 网站样式侵权微信定制开发 网站开发
  • 杭州市萧山区建设局网站南宁seo咨询
  • 海南网站设计新媒体运营
  • 网站打开网站制作及管理教程
  • 建设工程网站广州湛江哪里有建网站
  • 分类信息网站成都搭建网站查询域名
  • 网站建设费计入哪个科目2018年靖边建设项目招投标网站
  • 网站建设后台实训体会自考大专报名官网入口
  • 网站备案怎么做高端公司网站
  • 搭建 网站 模版百度互联网公司邯郸分公司