redis的最大批量调整为1024,避免因事务频繁失败,导致不能expire配置。

This commit is contained in:
zhengchao
2017-08-29 10:16:10 +08:00
parent 98889123aa
commit cdba1add45
2 changed files with 3 additions and 3 deletions

View File

@@ -733,7 +733,7 @@ int mr_transaction_success(redisReply* data_reply)
int _exec_serial_rule(redisContext* ctx,struct serial_rule_t* s_rule,int serial_rule_num, long long server_time); int _exec_serial_rule(redisContext* ctx,struct serial_rule_t* s_rule,int serial_rule_num, long long server_time);
int exec_serial_rule(redisContext* ctx,struct serial_rule_t* s_rule,int serial_rule_num, long long server_time) int exec_serial_rule(redisContext* ctx,struct serial_rule_t* s_rule,int serial_rule_num, long long server_time)
{ {
int max_redis_batch=8*1024,batch_cnt=0; int max_redis_batch=1*1024,batch_cnt=0;
int success_cnt=0,ret=0; int success_cnt=0,ret=0;
while(success_cnt<serial_rule_num) while(success_cnt<serial_rule_num)
{ {
@@ -909,7 +909,7 @@ void check_maat_expiration(redisContext *ctx, void *logger)
else else
{ {
MESA_handle_runtime_log(logger,RLOG_LV_INFO,maat_redis_monitor MESA_handle_runtime_log(logger,RLOG_LV_INFO,maat_redis_monitor
,"Failed to expired %d rules in Redis, try later.", s_rule_num); ,"Failed to expired %d/%d rules in Redis, try later.", s_rule_num-success_cnt,s_rule_num);
} }
free(s_rule); free(s_rule);

View File

@@ -28,7 +28,7 @@
#include "stream_fuzzy_hash.h" #include "stream_fuzzy_hash.h"
#include "gram_index_engine.h" #include "gram_index_engine.h"
int MAAT_FRAME_VERSION_2_0_20170825=1; int MAAT_FRAME_VERSION_2_0_20170829=1;
const char *maat_module="MAAT Frame"; const char *maat_module="MAAT Frame";
const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin", const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin",