Zend Framework 프로젝트가 있는데 나는을 Redis 클라이언트로 사용하기로 결정했습니다. Rediska에는 ZF 용 캐시 백엔드 어댑터 - Rediska_Zend_Cache_Backend_Redis가 있습니다.캐싱 중 "연결 읽기 시간이 초과되었습니다"라는 오류가 발생했습니다
개체의 DB 컬렉션에서 가져 와서 캐시에 저장하려고 시도하지만 오류가 발생합니다. Connection read timed out. 내 코드 예제 :
$rediskaOptions = array(
'name' => 'cache',
'namespace' => 'Cache_',
'servers' => array('cache' => array(
'host' => Rediska_Connection::DEFAULT_HOST,
'port' => Rediska_Connection::DEFAULT_PORT,
'password' => 'qwerty'
)
)
);
$cache = Zend_Cache::factory('Core', 'Rediska_Zend_Cache_Backend_Redis',
array('lifetime' => NULL, 'automatic_serialization' => true),
array('rediska' => $rediskaOptions), false, true
);
$cacheId = 'news_main';
if (!($topics = $cache->load($cacheId))) {
$topics = DAOFactory::getInstance()->getTopicDAO()->fetchTopic(1);
$cache->save($topics, $cacheId);
}
직렬화 후의 내용 크기는 26787 바이트입니다.Redis에는 전송에 크기 제한이있을 수 있습니까?
값에 대한 크기 제한이 이보다 훨씬 높습니다. 이론적 인 문자열 값의 한계는 512MB입니다. 26KB 오브젝트를 저장하는 데는 아무런 문제가 없어야합니다. –
readTimeout 매개 변수의 값은 무엇입니까? http://rediska.geometria-lab.net/documentation/configuration/servers/ –
내가 /etc/redis/redis.conf에 타임 아웃 0을 설정하고 rediska의 readTimeout에 기본값 - null이 있습니다. – Dmitro