Get redis to work on heroku

if you’ve tried to install toolbelt and then run redis but following these instructions:

https://devcenter.heroku.com/articles/nodejs

Then you know that you can just run redis. It errors out wit a message: Redis connection to 127.0.0.1:6379 failed – connect ECONNREFUSED

something like that…

follow this instead: https://devcenter.heroku.com/articles/redistogo#using-with-node

so install x-code command line tools from x-code preferences.

then download redis: http://redis.io/download

then follow these instructions: http://jasdeep.ca/2012/05/installing-redis-on-mac-os/

to get redis installed on your mac. Then run the redis server again.

Now you can test redis on heroku locally…

Note: if you’re also using something like socket.io, you must make sure to use redis to configure socket.io, otherwise it wont scale across processes

https://github.com/LearnBoost/Socket.IO/wiki/Configuring-Socket.IO

Also, worker processes are different than web processes. web will idle out after an hour if only one dyno is running. worker dynos never idle: https://devcenter.heroku.com/articles/dynos

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.