Hi agentzh,
New finding.
1) "lua socket tcp connect timed out" is in nginx error log when set_keepalive function of lua-resty-memcached module is called;
2) connect() function returns OK, while receive() function returns with error "failed to receive 1st line: timeout".
That agrees with the first point.
By ngx_lua source codes, I guess that connection's read event was triggered and finally ngx_http_lua_abort_pending_timers() was called;
3) The most weird is that, when I issued STATS command of memcached, curr_connections was only around 150 and listen_disabled_num was always 0.
memcached was started with -c 10240 and -b 10240, which is subject to memcached's effective user's ulimit;
Any suggestions?
Thanks a lot!
On Tuesday, November 12, 2013 9:02:04 AM UTC+8, agentzh wrote:
Hello!
On Mon, Nov 11, 2013 at 4:17 PM, microwish wrote:
> My application used memcached.lua and I took some load tests.
>
> If I explicitly called memcached.close(), a great number errors of
> "Connection refused" were logged. While I called
> memcached.set_keepalive(60000, 1000) instead of memcached.close(), that many
> errors of "lua tcp socket connect timed out" were logged.
>
It seems that you're overloading your memcached server. Ensure that
the TCP recv() queue and accept() queue in kernel are not dropping
packets on your memcached server side.
Regards,
-agentzh