Commit ec1f234c by 涂亚平

高并发优化压测版本

1 parent c9123771
...@@ -92,14 +92,15 @@ public class Scheduler { ...@@ -92,14 +92,15 @@ public class Scheduler {
/** /**
* 视频播放记录缩量 * 视频播放记录缩量
*/ */
//@Scheduled(cron = "0 35 18 * * ?") @Scheduled(cron = "0 48 14 * * ?")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void condenseVodPlayHistory() { public void condenseVodPlayHistory() {
List<VodPlayHistoryDO> list = vodPlayHistoryMapper.getVodPlayHistory(); List<VodPlayHistoryDO> list = vodPlayHistoryMapper.getVodPlayHistory();
List<VodPlayHistoryDO> vodPlayHistoryList = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>()); vodPlayHistoryMapper.delete(null);
for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryList) { //List<VodPlayHistoryDO> vodPlayHistoryList = vodPlayHistoryMapper.selectList(null);
vodPlayHistoryMapper.deleteById(vodPlayHistoryDO.getId()); //for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryList) {
} vodPlayHistoryMapper.deleteById(null);
//}
for (VodPlayHistoryDO vodPlayHistoryDO : list) { for (VodPlayHistoryDO vodPlayHistoryDO : list) {
vodPlayHistoryMapper.insert(vodPlayHistoryDO); vodPlayHistoryMapper.insert(vodPlayHistoryDO);
......
...@@ -12,6 +12,7 @@ import com.subsidy.mapper.ClassDictMapper; ...@@ -12,6 +12,7 @@ import com.subsidy.mapper.ClassDictMapper;
import com.subsidy.mapper.ClassHourDictMapper; import com.subsidy.mapper.ClassHourDictMapper;
import com.subsidy.mapper.ClassMemberMappingMapper; import com.subsidy.mapper.ClassMemberMappingMapper;
import com.subsidy.mapper.ExerciseDoneResultMapper; import com.subsidy.mapper.ExerciseDoneResultMapper;
import com.subsidy.mapper.MemberMapper;
import com.subsidy.mapper.SignInRecordMapper; import com.subsidy.mapper.SignInRecordMapper;
import com.subsidy.mapper.VodPlayHistoryMapper; import com.subsidy.mapper.VodPlayHistoryMapper;
import com.subsidy.model.AnsweringQuestionDO; import com.subsidy.model.AnsweringQuestionDO;
...@@ -19,6 +20,7 @@ import com.subsidy.model.ClassDictDO; ...@@ -19,6 +20,7 @@ import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ClassHourDictDO; import com.subsidy.model.ClassHourDictDO;
import com.subsidy.model.ClassMemberMappingDO; import com.subsidy.model.ClassMemberMappingDO;
import com.subsidy.model.ExerciseDoneResultDO; import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.model.MemberDO;
import com.subsidy.model.SignInRecordDO; import com.subsidy.model.SignInRecordDO;
import com.subsidy.model.VodDictDO; import com.subsidy.model.VodDictDO;
import com.subsidy.model.VodPlayHistoryDO; import com.subsidy.model.VodPlayHistoryDO;
...@@ -70,6 +72,9 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig ...@@ -70,6 +72,9 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
private RedisUtil redisUtil; private RedisUtil redisUtil;
@Autowired @Autowired
private MemberMapper memberMapper;
@Autowired
private ClassHourDictMapper classHourDictMapper; private ClassHourDictMapper classHourDictMapper;
public IPage<GetMemberSignInfoVO> getMemberSignInfo(GetMemberSignInfoDTO getMemberSignInfoDTO) { public IPage<GetMemberSignInfoVO> getMemberSignInfo(GetMemberSignInfoDTO getMemberSignInfoDTO) {
...@@ -250,6 +255,11 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig ...@@ -250,6 +255,11 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
redisUtil.set("subsidySettings_" + classHourDictDO.getCompanyId(), classHourDictDO); redisUtil.set("subsidySettings_" + classHourDictDO.getCompanyId(), classHourDictDO);
} }
//List<MemberDO> memberDOS = memberMapper.selectList(null);
//for (MemberDO memberDO : memberDOS){
// redisUtil.set(RedisPrefixConstant.SUBSIDY_COMPANY_MEMBER_PREFIX+memberDO.getCompanyId()+"_"+memberDO.getAccountName(),memberDO);
//}
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# 数据源配置 # 数据源配置
spring.datasource.url=jdbc:mysql://47.97.19.66:3306/subsidy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 spring.datasource.url=jdbc:mysql://47.97.19.66:3306/subsidy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
#spring.datasource.url=jdbc:mysql://rm-uf67mjh19252z6yg4eo.mysql.rds.aliyuncs.com:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 #spring.datasource.url=jdbc:mysql://rm-uf606h696n5qod70cfo.mysql.rds.aliyuncs.com:3306/subsidy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.username=ykadmin_new #spring.datasource.username=ykadmin_new
......
...@@ -64,12 +64,12 @@ spring.quartz.overwrite-existing-jobs=false ...@@ -64,12 +64,12 @@ spring.quartz.overwrite-existing-jobs=false
#spring.quartz.jdbc.initialize-schema=always #spring.quartz.jdbc.initialize-schema=always
#spring.datasource.initialization-mode=embedded #spring.datasource.initialization-mode=embedded
spring.task.execution.pool.allow-core-thread-timeout=true #spring.task.execution.pool.allow-core-thread-timeout=true
spring.task.execution.pool.core-size=8 #spring.task.execution.pool.core-size=8
spring.task.execution.pool.keep-alive=60 #spring.task.execution.pool.keep-alive=60
spring.task.execution.pool.max-size=200 #spring.task.execution.pool.max-size=200
spring.task.execution.pool.queue-capacity=200 #spring.task.execution.pool.queue-capacity=200
spring.task.execution.thread-name-prefix=subsidy- #spring.task.execution.thread-name-prefix=subsidy-
#spring.task.scheduling.pool.size=2 #spring.task.scheduling.pool.size=2
#spring.task.scheduling.thread-name-prefix=subsidy- #spring.task.scheduling.thread-name-prefix=subsidy-
...@@ -82,6 +82,10 @@ spring.task.execution.thread-name-prefix=subsidy- ...@@ -82,6 +82,10 @@ spring.task.execution.thread-name-prefix=subsidy-
#spring.redis.lettuce.pool.max-active=32 #spring.redis.lettuce.pool.max-active=32
#spring.redis.lettuce.pool.min-idle=8 #spring.redis.lettuce.pool.min-idle=8
#spring.redis.host=r-uf6m4cpkjrgpzywjm3pd.redis.rds.aliyuncs.com
#spring.redis.port=6379
#spring.redis.password=r-uf6m4cpkjrgpzywjm3:Ykhl@208
spring.redis.host=47.97.19.66 spring.redis.host=47.97.19.66
spring.redis.password=Ykhl@208 spring.redis.password=Ykhl@208
spring.redis.port=6389 spring.redis.port=6389
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
</sql> </sql>
<delete id="deleteById"> <delete id="deleteById">
delete from vod_play_history delete from vod_play_history
where id = #{id}
</delete> </delete>
<select id="studyHistory" parameterType="long" resultType="com.subsidy.vo.vod.StudyHistoryVO"> <select id="studyHistory" parameterType="long" resultType="com.subsidy.vo.vod.StudyHistoryVO">
...@@ -116,7 +115,7 @@ ...@@ -116,7 +115,7 @@
<select id="completeVodOrNot" resultType="integer"> <select id="completeVodOrNot" resultType="integer">
SELECT SELECT
IF IF
( max( t.play_record ) > t2.vod_length, 1, 0 ) AS count ( max( t.play_record ) > t2.vod_length*0.8, 1, 0 ) AS count
FROM FROM
vod_play_history t vod_play_history t
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!