Post 当我在nginx中设置worker_进程=8时,为什么会有这么多CLOSE_WAIT stage?

Post 当我在nginx中设置worker_进程=8时,为什么会有这么多CLOSE_WAIT stage?,post,nginx,redis,Post,Nginx,Redis,处理所有问题~我对nginx有一个问题:我的服务超时太多。ye,正如所猜测的,当我运行命令“netstat-tc | grep CLOSE”时,有两个多CLOSE\u WAITstage 背景: 最近,我做了一些反垃圾邮件的工作,并使用nginx(httppost方法)提供了一个服务器接口。我还使用redis存储了一些统计数据,供用户共享 八个nginx工作进程 问题: 当我在nginx.conf中设置worker_processes=1时,几乎不存在CLOSE_WAIT stage,超时也不太

处理所有问题~我对nginx有一个问题:我的服务超时太多。ye,正如所猜测的,当我运行命令“netstat-tc | grep CLOSE”时,有两个多CLOSE\u WAITstage

背景

最近,我做了一些反垃圾邮件的工作,并使用nginx(httppost方法)提供了一个服务器接口。我还使用redis存储了一些统计数据,供用户共享 八个nginx工作进程

问题

当我在nginx.conf中设置worker_processes=1时,几乎不存在CLOSE_WAIT stage,超时也不太严重

但是当nginx.conf中的i worker_processes=8时,会有很多超时,并关闭_等待阶段

我只是想知道为什么在设置worker_processs=8之后会出现大量超时,以及如何解决它

一些相关代码如下所示:

1.nginx.conf文件如下(省略一些不相关的行):

2.处理redis如下代码,rds_ctx初始化为golbal变量

void process_uid_balcklist_strategy(const text_info &info, redisContext *rds_ctx, rule_result &judge_res_rule) {                                        
  string redis_cmd = "GET " + info.from_source_type + "_Bfuid_" +   info.from_uid;
  redisReply *reply = (redisReply*)redisCommand(rds_ctx, redis_cmd.c_str());
  if (reply && reply->type != REDIS_REPLY_ERROR) {
    int level = 0; 
    if (reply->str) level = string_to_int(reply->str);
    if (level > 0) { 
      judge_res_rule.hit_rule += "fuid_black ";
      judge_res_rule.level = max(judge_res_rule.level, level);
  }    
  }
    if (reply) freeReplyObject(reply);
}
void process_uid_balcklist_strategy(const text_info &info, redisContext *rds_ctx, rule_result &judge_res_rule) {                                        
  string redis_cmd = "GET " + info.from_source_type + "_Bfuid_" +   info.from_uid;
  redisReply *reply = (redisReply*)redisCommand(rds_ctx, redis_cmd.c_str());
  if (reply && reply->type != REDIS_REPLY_ERROR) {
    int level = 0; 
    if (reply->str) level = string_to_int(reply->str);
    if (level > 0) { 
      judge_res_rule.hit_rule += "fuid_black ";
      judge_res_rule.level = max(judge_res_rule.level, level);
  }    
  }
    if (reply) freeReplyObject(reply);
}