Hello
On 31 May 2012 19:24, agentzh <
age...@gmail.com> wrote:
> Hello!
>
> On Thu, May 31, 2012 at 9:49 PM, Sparsh Gupta <
spars...@gmail.com> wrote:
>> lua socket read timed out,
>> [lua] common.lua:138: getURLsFromMemcache(): failed to retrieve key
>> URLs-8081 from memcache: failed to receive 1st line: timeout,
>> attempt to send data on a closed socket: u:00000000406AA728,
>> c:0000000000000000, ft:2 eof:0,
>
> When getURLsFromMemcache() fails, you should try reconnecting the
> resty.memcached object because the connection will become closed and
> subsequent operations (like your setURLsToMemcache and
> setSettingsToMemcache) on this object will return the "closed" errors.
Sure, I will do that to avoid, but ideally this shouldn't happen at
first place is my concern
>
> It seems that your memcached is still taking more than 1 sec to
> respond.
During the rush, I used memcache CLI to get some keys and it was super
fast (definately less than 1second, around 10-20ms maybe)
>What tool and what command are you using to press nginx?
tried ab (from different machine in same private network), and also
using external service (BLITZ); happening in both situations
>What concurrency level are you using?
This happened when I did concurrency of 500 :(
>Is it blowing your memcached server
> too hard and your memcached server is too busy?
Its not busy. Its a memcache which resides locally and connects over
unix socket. There is nothing else on the server and I am flushing and
restarting memcache everytime before hitting it. In the end I looked
at memcache stats and the read value if almost equal to the request I
sent using ab
>Maybe you should
> enlarge the timeout setting on your resty.memcached object?
I started with 200ms, made it 1000ms now, can always increase it but
then this is no good if its taking more than 1s
>Or maybe
> you should tune your memcached server?
I have memcached 1.4.5 on ubuntu 10.04 server started using following parameters
memcached -d -m 128 -s /tmp/memcached.sock -u www-data -c 16384
I can try increasing -c but 16384 is anyways way too high than 500
(which is hitting nginx)
Lemme know if I can debug this further to find more on this issue.
Happy to share my complete code and nginx config files if you wanna
look into it.
Thanks
Sparsh Gupta