有这样的一个问题
下面有个function 有大量的计算 top看worker跑到80% 多
function A()
结束之后有个redis的操作
lcoal start_time = ngx.time()
redis:cmd()
print(ngx.now() - start_time()) —2s多 timeout设置的是1s所以超时了
在 resty/redis.lua中加时间记录
local function _read_reply(self, sock)
lcoal start_time = ngx.time()
local line, err = sock:receive()
print(ngx.now() - start_time()) —2s多
redis的操作是一个非常非常简单的操作,reids的处理在ms级别,这里却消耗了2s多
目前有一个解决方法就是 在 function A 结束之后ngx.sleep(0.1) 就一切正常。但是很奇怪不知道出现上面的原因,有没有什么方向可以提供做这个问题的定位排查