Closed Vortexxxx closed 6 years ago
@Vortexxxx I noted one obvious mistake: when result is not found ("dog not found"), you should also call set_keepalive()
otherwise the connection would be closed automatically.
Also, requests may not get very even across all the 4 nginx worker processes (enabling reuseport
in the listen directive can be helpful). But still 0 means something is definitely wrong here.
Another suggestion is to produce error logs when your set_keepalive()
call returns any errors (instead of simply writing back to the client, which you may not see at all).
One further debugging tip is to temporarily enable the nginx debugging logs to see what's happening inside the nginx core.
@agentzh Thank you very much for your reply, it is working now
Hi there, Happy new year
The code basically comes from the Synopsis:
I tryed pressure test, the nginx config have 4 nginx worker, So I expect memcache will keep 400 connections after the test is done, but I got 0.
I tried a similar test using lua-resty-redis and found the result normal