{"action":"closed","issue":{"url":"https://api.github.com/repos/openresty/lua-resty-memcached/issues/19","repository_url":"https://api.github.com/repos/openresty/lua-resty-memcached","labels_url":"https://api.github.com/repos/openresty/lua-resty-memcached/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/openresty/lua-resty-memcached/issues/19/comments","events_url":"https://api.github.com/repos/openresty/lua-resty-memcached/issues/19/events","html_url":"https://github.com/openresty/lua-resty-memcached/issues/19","id":299214938,"number":19,"title":"How to use the connect pool properly? ","user":{"login":"Vortexxxx","id":29770643,"avatar_url":"https://avatars2.githubusercontent.com/u/29770643?v=4","gravatar_id":"","url":"https://api.github.com/users/Vortexxxx","html_url":"https://github.com/Vortexxxx","followers_url":"https://api.github.com/users/Vortexxxx/followers","following_url":"https://api.github.com/users/Vortexxxx/following{/other_user}","gists_url":"https://api.github.com/users/Vortexxxx/gists{/gist_id}","starred_url":"https://api.github.com/users/Vortexxxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vortexxxx/subscriptions","organizations_url":"https://api.github.com/users/Vortexxxx/orgs","repos_url":"https://api.github.com/users/Vortexxxx/repos","events_url":"https://api.github.com/users/Vortexxxx/events{/privacy}","received_events_url":"https://api.github.com/users/Vortexxxx/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-22T04:04:52Z","updated_at":"2018-02-27T08:40:16Z","closed_at":"2018-02-27T08:40:16Z","author_association":"NONE","body":"Hi there, Happy new year\r\n\r\nThe code basically comes from the Synopsis:\r\n\r\n```lua\r\nlocal memcached = require \"resty.memcached\"\r\nlocal memc, err = memcached:new()\r\n\r\nif not memc then\r\n    ngx.log(ngx.ERR, err)\r\n    ngx.exit(ngx.HTTP_SERVICE_UNAVAILABLE)\r\nend\r\n\r\nmemc:set_timeout(3000)\r\n\r\nlocal ok, err = memc:connect(\"127.0.0.1\", 11211)\r\nif not ok then\r\n    ngx.log(ngx.ERR, err)\r\n    ngx.exit(ngx.HTTP_SERVICE_UNAVAILABLE)\r\nend\r\n\r\nlocal res, flags, err = memc:get(\"dog\")\r\nif err then\r\n    ngx.say(\"failed to get dog: \", err)\r\n    return\r\nend\r\n\r\nif not res then\r\n    ngx.say(\"dog not found\")\r\n    return\r\nend\r\nlocal ok, err = memc:set_keepalive(100000, 100)\r\nif not ok then\r\n    ngx.say(\"cannot set keepalive: \", err)\r\n    return\r\nend\r\n```\r\nI 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.\r\n\r\nI tried a similar test using lua-resty-redis and found the result normal"}}
{"actor":{"display_login":"Vortexxxx"}}