Tag: redistogo

用socket.io-redis和RedisToGo在Heroku上扩展到2+ dynos

我正在尝试使用socket.io-redis来将我的Heroku应用程序扩展到2个dynos(或更多)。 这里是我的代码(config.redis只是一个包含RedisToGo端口,主机和传递值的对象): var redisApp = require('redis'); var redis = require('socket.io-redis'); if(process.env.NODE_ENV === 'production') { var socketpub = redisApp.createClient(config.redis.port, config.redis.host, {auth_pass: config.redis.pass, return_buffers: true}); var socketsub = redisApp.createClient(config.redis.port, config.redis.host, {auth_pass: config.redis.pass, detect_buffers: true}); var client = redisApp.createClient(config.redis.port, config.redis.host, {auth_pass: config.redis.pass, return_buffers: true}); socketio.adapter(redis({ pubClient: socketpub, subClient: socketsub, redisClient: client })); } 在客户端我有: var ioSocket = io('', […]

RedisToGo在heroku上“本地”可用吗?

我打算使用Redis进行会话存储。 根据这个问题: 什么是单主机Node.js生产应用程序的良好会话存储? 似乎redis在“本地”不可用的时候并不快。 在heroku上看起来如何? 假设我在Heroku上部署了我的节点应用程序,并将其扩展为4个实例: web.1 web.2 web.3 web.4 假设我configuration了addon redisToGo并将其用作会话存储。 这样的redis实例的速度会是什么? 就像“本地”或“远程”一样? 将它用于会话存储是一个好主意?