我正在使用节点+表达式应用程序并使用connect-memcached来存储使用Memcached客户端与Memcached服务器通信的快速会话。我想通过连接池使用Memcached。到目前为止,我已经尝试过这个: -
var session = require('express-session');
var MemcachedStore = require('connect-memcached')(session);
var servers = [];
if (typeof cacheAddr === 'string') servers.push(cacheAddr + ':' + cachePort);
else {
for(var i = 0; i < cacheAddr.length; i++)
servers.push(cacheAddr[i] + ':' + cachePort);
}
var store = {
secret : secret,
key : 'its',
proxy : 'true',
store : new MemcachedStore({
hosts: servers,
prefix: 'sess:',
poolSize: 200
}),
saveUninitialized: true,
resave: true,
unset: 'destroy'
};
}
var sessionStore = session(store);
我的memcached服务器上的答案 0 :(得分:0)
It is correct. The load was not enough, so I was not seeing 200 active connections. On increasing the load, I got to see 200 active connections.