노드 버전 : v.2.6.2NodeRedis client.multi() hgetall 성능
redis_version : 2.8.4
우분투 14.04 2기가바이트 RAM VPS 인스턴스
노드 레디 스 버전 v7.4.0
node_redis hgetall 성능이 있어야하는 것은 아니라는 표시가 나타납니다.하지만 아마도 잘못된 것입니다. 31669 개의 요소가있는 정렬 된 집합이 있습니다. 요소는 해시 키이고 각 해시는 14 개의 필드를 가지며 ~ 256 바이트입니다. 해시를 검색하는 데는 ~ 64 초가 걸리고 너무 느립니다.
function getAllAnnotations()
{
var currentSeconds = Math.floor((new Date()).getTime()/1000);
console.log('currentSeconds before zrange: ' + currentSeconds);
client.zrangebyscore("geoHashSortedSet", "-inf", "+inf", function(err, reply) {
multi = client.multi();
for (var uuid in reply) {
multi.hgetall(reply[uuid]);
}
multi.exec(function(err, replies) {
var currentSeconds = Math.floor((new Date()).getTime()/1000);
console.log('currentSeconds after multi returns: ' + currentSeconds);
allAnnotations = replies;
});
});
}
여기에 다른 사람이 성능 저하 것을 동의 하는가, 그리고 그 문제의 일부입니다 위의 코드에서하고있어 거기에 아무것도 : 여기 함수의 모습인가?
['client.batch()'] (https://github.com/NodeRedis/node_redis#clientbatchcommands)를 사용해 보셨습니까? 또한 배치의 타이밍을 정하는 것이 아니라 'zrangebyscore'도 있습니다. – robertklep
나는 client.batch()를 시도 할 것이다. 그리고 예, 나는 zrangebyscore를 타이밍한다는 것을 알고있었습니다. 아마 나는 그것을 포함해서는 안된다. 감사. – bhartsb