I have a Heroku App using 3 dynos: 1 web and 2 worker dynos. For inter-dyno-communication I choose memcachier, everthing is implemented using nodejs.
The Web-Dyno has no problems connecting to the memcacher service and works like a charme, but trying to connect with a worker dyno fails and the TCP connection receives a reset:
MemJS: Server <mc5.dev.ec2.memcachier.com:11211> failed after (2) retries with error - write ECONNRESET
The method I am connecting to the service is the same that already works in the Web-Dyno..
Where is the problem?
This Code:
var MemJS = require('memjs').Client,
memjs = MemJS.create();
setInterval(function () {
memjs.set('test', 'test');
memjs.get('test', function (err, buf) {
if (err)
console.log('ERROR with the damn memcache service ' + err);
else
console.log('Memcache service working: ' + buf.toString());
});
}, 5000);
Works on the web-dyno but doesn't work on the worker-dyno..