R
Railway8mo ago
snöw

ioredis and internal network redis

Trying to connect to redis in node using ioredis and the new private URL, which it doesn't seem to recognise Has anyone gotten redis working over the internal network?
No description
18 Replies
Percy
Percy8mo ago
Project ID: 1cb9508e-4a99-456d-a6fc-4ae49f946789
snöw
snöw8mo ago
1cb9508e-4a99-456d-a6fc-4ae49f946789
ThallesComH
ThallesComH8mo ago
private networking contains a problem where it takes about 100ms to initialize. see docs https://docs.railway.app/reference/private-networking#workaround-for-alpine-based-images
Railway Docs
Private Networking | Railway Docs
Documentation for Railway
snöw
snöw8mo ago
this is in runtime, the 100ms shouldn't be a problem there and also not on alpine afaik
ThallesComH
ThallesComH8mo ago
that occurs during runtime and it's not a alpine thing only
ThallesComH
ThallesComH8mo ago
No description
snöw
snöw8mo ago
by runtime I meant that I'm attempting the connection way after the redis service is deployed or is the 100ms for each connection?
ThallesComH
ThallesComH8mo ago
after each deploy, Railway will bring up a private connection using wireguard (vpn basically) but it takes about 100ms to initialize. so you can delay your application start up or try request loop as suggested until it's up
snöw
snöw8mo ago
I attempt the connection to redis from a node application - not during the startup, rather in response to incoming requests by then both services should be initialized I might be misunderstanding something 😄
ThallesComH
ThallesComH8mo ago
ah ok, make sense now
snöw
snöw8mo ago
i suspect this might be an ipv6/ipv4 thing ioredis has been picky with ipv6 in the past
ThallesComH
ThallesComH8mo ago
maybe, node prefers IPv6 now over IPv4
snöw
snöw8mo ago
yep I think i'll just use the public url, the speed difference isn't that important atm
ThallesComH
ThallesComH8mo ago
GitHub
Unhandled error event: Error: getaddrinfo ENOTFOUND - AWS ElasticC...
Hey guys, did anyone have some issue like that to connect in the AWS ElasticCache in the ECS Container? [ioredis] Unhandled error event: Error: getaddrinfo ENOTFOUND cursobeta-dev-elasticache-redis...
acron
acron8mo ago
I'm not seeing a REDIS_PRIVATE_URL advertised in the "Available Variables" tab of my redis service. Does this mean internal is not available? All my other services have Private Networking addresses so I assume it's enabled for my environment.. In fact, I just tried using it in a Variable for another service...
acron
acron8mo ago
No description
acron
acron8mo ago
and it was empty
Fragly
Fragly8mo ago
( ^ acron's question moved to: #Redis doesn't seem to be on Private network )