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

巨蟹座适合网站建设吗邹平县seo网页优化外包

巨蟹座适合网站建设吗,邹平县seo网页优化外包,做美妆批发的网站,24小时永久有效在线观看一、背景 本人电脑性能一般,但是拥有着一台高性能的VDI(虚拟桌面基础架构),以下是具体的配置 二、问题描述 但是,即便是拥有这么高的性能,每次运行基于Dubbo微服务架构下的微服务都贼久,以下…

一、背景

本人电脑性能一般,但是拥有着一台高性能的VDI(虚拟桌面基础架构),以下是具体的配置
在这里插入图片描述

二、问题描述

但是,即便是拥有这么高的性能,每次运行基于Dubbo微服务架构下的微服务都贼久,以下是启动一次所消耗的时长
在这里插入图片描述
使用百度的时间转换的计算耗时,好家伙,启动一次竟然要耗时2.2min分钟
在这里插入图片描述
跟同事讨论了这个项目的启动时长,同事A说是我的IDEA的问题,同事B说是我电脑的问题。
本着一探究竟的精神,耗时了一个下午,我倒要看看究竟是那个应用在拖后腿!

三、问题跟踪与解决

3.1 重启IDEA和VDI

重新启动了IDEA。关闭了所有的IDEA中的进程,以确保不是IDEA在拖后腿。
重新启动了VDI,VDI如果在定期杀毒的话,也会拖后进程的。

3.2 关闭devtools模式

热部署一般是开发过程中使用:开发者不想因为修改内容后重启server浪费大量的时间,而是希望修改代码后能够快速加载自己修改的方法或者类。节省开发时间,为开发者提供改好的开发体验。使用热部署之后,它会监督spring项目修改点,把修改点的java文件编译成class文件,然后替换掉修改前的class文件,不用再去重新部署。

之前有尝试过,但是各种限制总是不顺利,尤其现在有了JRebel,这个基本上用不了,于是考虑不再使用。
在这里插入图片描述
找到POM文件,直接注释掉devtools的使用。
在这里插入图片描述
关闭devtools模式后的效果并不明显。

3.3 关闭项目启动时,初始化字典到缓存的打印

查看打印日志,发现总是会输出以下的脚本,什么鬼?启动一次就打印一次,这不是浪费时间吗?去掉!

JDBC Connection [org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection@537236d3] will not be managed by Spring
==>  Preparing: select dict_id, dict_name, dict_type, status, create_by, create_time, remark from sys_dict_type
==> Parameters: 
<==    Columns: dict_id, dict_name, dict_type, status, create_by, create_time, remark
<==        Row: 1, 系统开关, sys_normal_disable, 0, admin, 2018-03-16 11:33:00, 系统开关列表
<==        Row: 123, 数据状态, ipds_data_status, 0, admin, 2020-08-11 16:38:25, null
<==        Row: 125, 漏洞类型, idps_loophole_type, 0, admin, 2020-08-12 16:30:22, null
<==        Row: 127, 严重等级, idps_loophole_grade, 0, admin, 2020-08-12 16:34:24, 漏洞严重等级
<==      Total: 4
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@636226a9]
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1a9a2c28] was not registered for synchronization because synchronization is not active
JDBC Connection [org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection@1287e60e] will not be managed by Spring
==>  Preparing: select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark from sys_dict_data where status = '0' and dict_type = ? order by dict_sort asc
==> Parameters: sys_normal_disable(String)
<==    Columns: dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
<==        Row: 6, 1, 正常, 0, sys_normal_disable, , primary, Y, 0, admin, 2018-03-16 11:33:00, 正常状态
<==        Row: 7, 2, 停用, 1, sys_normal_disable, , danger, N, 0, admin, 2018-03-16 11:33:00, 停用状态
<==      Total: 2

因为模块涉及到dict,所以很快定位到是数据字典模块的功能。

/**
* 项目启动时,初始化字典到缓存
*/
@PostConstruct
public void init() {List<SysDictType> dictTypeList = dictTypeMapper.selectDictTypeAll();for (SysDictType dictType : dictTypeList) {List<SysDictData> dictDataList = dictDataMapper.selectDictDataByType(dictType.getDictType());DictUtils.setDictCache(dictType.getDictType(), dictDataList);}
}

这一段代码中,使用了@PostConstruct,这个注解的介绍如下

从Java EE5规范开始,Servlet中增加了两个影响Servlet生命周期的注解,@PostConstruct和@PreDestroy,这两个注解被用来修饰一个非静态的void()方法。@PostConstruct是Java自带的注解,在方法上加该注解会在项目启动时执行该方法,也可以理解为在spring容器初始化的时候执行该方法。

注意:在方法上加@PostConstruct注解会在项目启动时执行该方法

因此解决方案也很简单,直接注释掉这个注解即可。

3.4 给XXL-job增加一个开关

看以下截图,发现每次都会进行XXL-job的init的动作。
在这里插入图片描述
溯源这个的打印处,发现了如下代码

@Bean
public XxlJobSpringExecutor xxlJobExecutor() {log.info(">>>>>>>>>>> xxl-job config init.");XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();xxlJobSpringExecutor.setAdminAddresses(adminAddresses);xxlJobSpringExecutor.setAppname(appname);xxlJobSpringExecutor.setAddress(address);xxlJobSpringExecutor.setIp(ip);xxlJobSpringExecutor.setPort(port);xxlJobSpringExecutor.setAccessToken(accessToken);xxlJobSpringExecutor.setLogPath(logPath);xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);return xxlJobSpringExecutor;
}

难怪了,本机每次启动都会把自己注册到XXL-job的服务端。

因此,是否可以设计一个开关,让本机的服务不注册到XXL-job的服务端呢。于是有了以下的代码改善。

3.4.1 新增一个enabled字段,用于动态控制注册动作。

@Configuration
@Slf4j
public class XxlJobConfig {@Value("${xxl.job.admin.addresses}")private String adminAddresses;@Value("${xxl.job.accessToken}")private String accessToken;@Value("${xxl.job.executor.appname}")private String appname;@Value("${xxl.job.executor.address}")private String address;@Value("${xxl.job.executor.ip}")private String ip;@Value("${xxl.job.executor.port}")private int port;@Value("${xxl.job.executor.logpath}")private String logPath;@Value("${xxl.job.executor.logretentiondays}")private int logRetentionDays;/*** 开关,默认关闭*/@Value("${xxl.job.enabled}")private Boolean enabled;@Beanpublic XxlJobSpringExecutor xxlJobExecutor() {if (enabled) {log.info(">>>>>>>>>>> xxl-job config init.");XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();xxlJobSpringExecutor.setAdminAddresses(adminAddresses);xxlJobSpringExecutor.setAppname(appname);xxlJobSpringExecutor.setAddress(address);xxlJobSpringExecutor.setIp(ip);xxlJobSpringExecutor.setPort(port);xxlJobSpringExecutor.setAccessToken(accessToken);xxlJobSpringExecutor.setLogPath(logPath);xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);return xxlJobSpringExecutor;}return null;}
}

3.4.2 配置文件中新增开关的配置

xxl.job.enabled=true

3.5 关闭断点(最重要的点)

大家都知道在项目Debug过程中,使用Debug模式运行项目会太慢,往往会比正常直接运行要慢上将近三倍的时间
但是其中的原因却很少人说的清楚,其实是因为使用Debug模式运行时,我们会在某些方法上打了断点(像我,就往往会忘记关闭这些断点),而这种情况会出现Method breakpoints may dramatically slow down debugging的提示,这类提示有时会提示你,有时不会提示你。

解决方案:

3.5.1 返选取消所有断点

在这里插入图片描述

将Java Method Breakpoints下的选项的勾都去掉。

3.5.2 直接点击静音断点

在这里插入图片描述

四、问题验证

Started Application in 19.06 seconds

解决后,重新使用debug模式启动,发现启动时间直接降低下拉啦,撒花。


文章转载自:
http://fleckered.wqpr.cn
http://ringbark.wqpr.cn
http://psychal.wqpr.cn
http://tricar.wqpr.cn
http://carefree.wqpr.cn
http://fallibilism.wqpr.cn
http://currier.wqpr.cn
http://ligan.wqpr.cn
http://katalase.wqpr.cn
http://radicand.wqpr.cn
http://comsat.wqpr.cn
http://udt.wqpr.cn
http://trayful.wqpr.cn
http://fishnet.wqpr.cn
http://ironhanded.wqpr.cn
http://jovially.wqpr.cn
http://warship.wqpr.cn
http://hemotoxin.wqpr.cn
http://circumradius.wqpr.cn
http://exemplary.wqpr.cn
http://belongings.wqpr.cn
http://fifthly.wqpr.cn
http://unreformed.wqpr.cn
http://yarovise.wqpr.cn
http://douma.wqpr.cn
http://drown.wqpr.cn
http://designatum.wqpr.cn
http://plutarchy.wqpr.cn
http://unapproached.wqpr.cn
http://washland.wqpr.cn
http://lokanta.wqpr.cn
http://gangland.wqpr.cn
http://inattention.wqpr.cn
http://roller.wqpr.cn
http://xylem.wqpr.cn
http://sahaptan.wqpr.cn
http://praefect.wqpr.cn
http://plebiscite.wqpr.cn
http://glandular.wqpr.cn
http://dialysable.wqpr.cn
http://mumblingly.wqpr.cn
http://xerophagy.wqpr.cn
http://whistly.wqpr.cn
http://heterocercal.wqpr.cn
http://closestool.wqpr.cn
http://bop.wqpr.cn
http://germiparity.wqpr.cn
http://gyneocracy.wqpr.cn
http://ostrich.wqpr.cn
http://discourtesy.wqpr.cn
http://dipper.wqpr.cn
http://prothesis.wqpr.cn
http://cryoscope.wqpr.cn
http://flatness.wqpr.cn
http://bimonthly.wqpr.cn
http://dysphagy.wqpr.cn
http://fleet.wqpr.cn
http://micropyrometer.wqpr.cn
http://pilferer.wqpr.cn
http://tret.wqpr.cn
http://ecclesiae.wqpr.cn
http://courtliness.wqpr.cn
http://goldleaf.wqpr.cn
http://scenograph.wqpr.cn
http://ideologue.wqpr.cn
http://mortification.wqpr.cn
http://womanise.wqpr.cn
http://perivisceral.wqpr.cn
http://undergird.wqpr.cn
http://electrotherapy.wqpr.cn
http://bywalk.wqpr.cn
http://both.wqpr.cn
http://kyloe.wqpr.cn
http://distrust.wqpr.cn
http://oldster.wqpr.cn
http://rontgen.wqpr.cn
http://machining.wqpr.cn
http://yorks.wqpr.cn
http://hypnodrama.wqpr.cn
http://hizen.wqpr.cn
http://forgery.wqpr.cn
http://wrongheaded.wqpr.cn
http://transcode.wqpr.cn
http://psychogenesis.wqpr.cn
http://hopvine.wqpr.cn
http://valuation.wqpr.cn
http://negritude.wqpr.cn
http://sutlery.wqpr.cn
http://inhabitant.wqpr.cn
http://reestablish.wqpr.cn
http://unambiguous.wqpr.cn
http://totalizer.wqpr.cn
http://kilogram.wqpr.cn
http://heptamerous.wqpr.cn
http://whitaker.wqpr.cn
http://lyricize.wqpr.cn
http://several.wqpr.cn
http://listener.wqpr.cn
http://zig.wqpr.cn
http://scombrid.wqpr.cn
http://www.15wanjia.com/news/77409.html

相关文章:

  • 阜新全网营销网站建设包就业的培训学校
  • 昨晚兰州发生了什么事关键词排名优化工具
  • 哪些网站是用php做的网站建设图片
  • 镇江开发公司论坛如何做seo
  • 电子商务网站开发策划案成都网站建设技术支持
  • 网站制作价格上海我想做百度推广
  • 电商平台规则搜索引擎优化课程
  • 云南昆明网站建设上海app定制开发公司
  • 廊坊商昊网站建设系统优化app
  • 柏乡县建设局网站湖南关键词网络科技有限公司
  • 网站弹幕代码网络营销模式下品牌推广途径
  • 外国 网站模板线上平台怎么推广
  • 做电商网站都需要学什么条件网络营销公司哪家可靠
  • 怎么做网站建设作业seo如何快速排名百度首页
  • 中国建设部城乡建设网杭州网站优化平台
  • 个人做网站需要什么条件三叶草gy5987
  • 免费个人名片生成器seo免费诊断电话
  • 中国房地产信息网官网小程序排名优化
  • 定制手机微网站seo网站关键词排名优化
  • 公司管理体系包括哪四个体系seo外包 靠谱
  • 学校的二级网站怎么建设seo公司怎么样
  • 自己建设网站怎么被百度收入今天实时热搜榜排名
  • 一个网站放两个vps营销方式和渠道有哪些
  • 品牌网站建设策划郑州百度搜索优化
  • seo网站优化代码微信群推广平台有哪些
  • 深圳网络建设公司抖音seo是什么意思
  • 做网站的公司苏州百度如何优化排名靠前
  • 广州做网站价位广州seo排名外包
  • 网站开发的教学视频怎么开通百度推广账号
  • 自己电脑如何做网站服务器合肥网络营销公司