摘要: 问题:下单操作需要多次调用数据库,查询商品信息,用户信息,修改库存数据,造成性能瓶颈。 优化方向:读取数据改为从缓存读取,修改库存数据改为修改缓存数据在用消息队列异步修改数据库。可以用rocketmq的异步事务型消息来保证redis和数据库数据同步,在缓存异常情况可以用数据库数据来恢复。 1.交易验 阅读全文
posted @ 2019-12-23 11:47 haohao1234 阅读(433) 评论(0) 推荐(0) 编辑
摘要: 1.redis集中式缓存 //商品详情页浏览 @RequestMapping(value = "/get",method = {RequestMethod.GET}) @ResponseBody public CommonReturnType getItem(@RequestParam(name = 阅读全文
posted @ 2019-12-16 23:12 haohao1234 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 将nginx,java,mysql分别安在不同的服务器上 1.安装openresty, 按照官网操作 https://openresty.org/en/linux-packages.html https://openresty.org/cn/getting-started.html #启动openr 阅读全文
posted @ 2019-12-07 21:26 haohao1234 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 1.查看进程使用情况 ps -ef | grep java 查看进程号,30589 netstat -anp | grep 30589 查看该进程的使用情况 pstree -p 30589 | wc -l 查看线程数 top -H 查看CPU使用情况 [root@iZbp1dtm752cu7uoi7 阅读全文
posted @ 2019-12-02 17:07 haohao1234 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 1.springboot打包 <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1 阅读全文
posted @ 2019-11-27 17:58 haohao1234 阅读(237) 评论(0) 推荐(0) 编辑