How to handle Memcache timeouts?

0

We run a Elastic cache Memcache server that store around 30,000 items and gets queried and updated around 50 times per second. One request per client. During a peak load we started to see Memcached get() calls timeouts and set() erroring as well.

The get() calls failed with error 31 which RES_TIMEOUT or MEMCACHED_TIMEOUT the set() calls then failed with error 47 which is MEMCACHED_SERVER_TEMPORARILY_DISABLED

memcached constants from: https://www.php.net/manual/en/memcached.getresultcode.php

Version specifics. Memcache (v1.6.6) - 1 node in a cluster Clients: php7, Ubuntu v20, memcached version (v1.5.22)

Now if we had implemented an memcache multiple node cluster, utilized the ElastiCache cluster client with auto discovery, and that there was a health node in the cluster, does auto discovery failover to other nodes in the cluster or do we have to build that logic into out application?

Our caching is strings and small images. Alternatively, should we move to a Redis cluster? From what I understand Redis automatically promotes a replica to a new master in the event of a failure.

Thanks for any suggestions!

1개 답변
0

Hi, I think that the 1st thing you need to do is to understand the source of your timeouts: max number of parallel connections reached, etc.

You should follow those pages to diagnose:

Didier

profile pictureAWS
전문가
답변함 10달 전
  • Thanks for the links Didier, I do see some information that is helpful/interesting. What I'm really trying to determine though is, not so much identifying why we hit some timeouts or how to fix them. More I'm trying to determine if memcache returns a timeout message, would we failover to another node in a memcache cluster or do we have to build that failover/rerouting into our application? Alternatively does Redis provide automatic failover in this scenario? Either failover of replica replacement?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠