摘要: 1 添加注解 @AccessLimit(secondes=5, maxCount=5, neeLogin=true) 2 注解类定义 package com.imooc.miaosha.access;import java.lang.annotation.ElementType;import jav 阅读全文
posted @ 2021-07-10 22:07 weidalin 阅读(73) 评论(0) 推荐(0)
摘要: 1 在lvs主机master 上配置虚拟ip 1 将编写好的lvs_dr.sh 以及lvs_rs.sh都发送到两台lv主机以及real server上 (错误的做法,在window上编写的shell脚本很有可能在UNIX上无法执行 scp lvs_dr.sh ubuntu@192.168.138.1 阅读全文
posted @ 2021-07-10 22:04 weidalin 阅读(212) 评论(0) 推荐(0)
摘要: 1 准备将tomcat 压缩包解压,复制成两份 如将一个tomcat8.tar.gz 文件解压之后复制两份,分别命名为tomcat8_8080 tomcat8_8081 2 修改/etc/profile sudo vim /etc/profile ``` 开启多个tomcat CATALINA_BA 阅读全文
posted @ 2021-07-10 22:02 weidalin 阅读(249) 评论(0) 推荐(0)
摘要: 1 sudo apt-get install ipvsadm 2 在lvs机器中 1 写lvs_dr.sh添加虚拟网卡 sudo vim /usr/local/bin/lvs_dr.sh #! /bin/bash echo 1 > /proc/sys/net/ipv4/ip_forward ipv= 阅读全文
posted @ 2021-07-10 22:01 weidalin 阅读(60) 评论(0) 推荐(0)
摘要: 1 操作系统优化 vi /etc/sysctl.conf 防止一个套接字在有过多试图连接到达时引起过载 sysctl -w net.ipv4.tcp_syncookies=1 默认128,连接队列 (解释:最大连接数是1w,但是超过了怎么办,那就放到队列里) sysctl-w net.core.so 阅读全文
posted @ 2021-07-10 22:00 weidalin 阅读(39) 评论(0) 推荐(0)
摘要: 1 安装 https://github.com/lebinh/ngxtop pip install ngxtop 2 使用 指定配置文件 ngxtop -c ./conf/nginx.conf 查询状态是200 ngxtop -c ./conf/nginx.conf --filter 'status 阅读全文
posted @ 2021-07-10 21:59 weidalin 阅读(64) 评论(0) 推荐(0)
摘要: 1 开启缓存,二级目录 # 开启缓存,二级目录 proxy_cache_path /usr/local/nginx/proxy_cache levels=1:2 keys_zone=cache_one:200m inactive=1d max_size=20g; proxy_ignore_heade 阅读全文
posted @ 2021-07-10 21:58 weidalin 阅读(55) 评论(0) 推荐(0)
摘要: 文档:http://nginx.org/en/docs/ ngin_status: 并发统计 Ngxtop : 请求统计 1 并发优化 sudo vim /usr/local/nginx/conf/nginx.conf user gigabyte; #用户 worker_processes 4; # 阅读全文
posted @ 2021-07-10 21:56 weidalin 阅读(225) 评论(0) 推荐(0)
摘要: 1.内存优化catalina vi ./bin/catalina.sh Xms 最小内存,Xmx 最大内存 JAVA_OPTS="-server -Xms2048M -Xmx2048M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseCMSCompa 阅读全文
posted @ 2021-07-10 21:54 weidalin 阅读(103) 评论(0) 推荐(0)
摘要: 1 MiaoshaController implements InitializingBean / 系统初始化时获取商品库存 @throws Exception /@Overridepublic void afterPropertiesSet() throws Exception { List&lt 阅读全文
posted @ 2021-07-10 21:52 weidalin 阅读(77) 评论(0) 推荐(0)
摘要: 1 安装rabitmq 1 安装 https://my.oschina.net/u/2364788/blog/2875902 sudo apt install xmlto -y sudo apt install python-simplejson -y sudo apt-get install cu 阅读全文
posted @ 2021-07-10 21:49 weidalin 阅读(106) 评论(0) 推荐(0)
摘要: 1 更新 先把数据存到数据库中,成功后,再让缓存失效 2当设置了redis缓存获取页面html之后,编辑了页面静态化代码, 而前端页面依然显示的是之前非页面静态化的请求 解决: 去服务器删除缓存 成功 解决: 还有一个坑就是,浏览器有缓存,你修改的代码一直上传不上去,这时可以通过清理浏览器的缓存解决 阅读全文
posted @ 2021-07-10 21:47 weidalin 阅读(55) 评论(0) 推荐(0)
摘要: 1 页面缓存 1 添加自定义Key类 public class GoodsKey extends BasePrefix { private GoodsKey(int expireSecondes, String prefix) { super(expireSecondes, prefix); } p 阅读全文
posted @ 2021-07-10 21:45 weidalin 阅读(105) 评论(0) 推荐(0)
摘要: 一、war 包 1 pom.xml 依赖 dependecies 里添加spring-boot-starter-tomcat 的provided依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring 阅读全文
posted @ 2021-07-10 21:43 weidalin 阅读(61) 评论(0) 推荐(0)
摘要: 1 查询商品 goods/to_list 3 10000 * 10 2 查询用户 user/info 3 csv config user,userToken 19860207586,beee92446e3349bdb3b2321c5eed6d24 4 JMeter 命令行 在windows上录好jm 阅读全文
posted @ 2021-07-10 21:42 weidalin 阅读(103) 评论(0) 推荐(0)
摘要: 1 首先登陆成功之后跳转到订单列表 $.ajax({ url: "/login/do_login", type: "POST", data:{ mobile:$("#mobile").val(), password: password }, success:function(data){ layer 阅读全文
posted @ 2021-07-10 21:41 weidalin 阅读(168) 评论(0) 推荐(0)
摘要: 1 登录操作的controller @RequestMapping("/do_login") @ResponseBodypublic Result<Boolean> doLogin(HttpServletResponse response, @Valid LoginVo loginVo){ log. 阅读全文
posted @ 2021-07-10 21:39 weidalin 阅读(52) 评论(0) 推荐(0)
摘要: 1 引入JSR依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency> </dependencie 阅读全文
posted @ 2021-07-10 21:38 weidalin 阅读(85) 评论(0) 推荐(0)
摘要: 1 明文密码两次md5入库 1 pom.xml引入md库 <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.6</version> </depend 阅读全文
posted @ 2021-07-10 21:37 weidalin 阅读(36) 评论(0) 推荐(0)
摘要: 1. spring-boot集成Redis 1 pom.xml中添加Jedis依赖, 添加Fastjson依赖 <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> </dependency> <de 阅读全文
posted @ 2021-07-10 21:36 weidalin 阅读(66) 评论(0) 推荐(0)