Menu
  • HOME
  • TAGS

What's an idiomatic way to reconnect to Redis subscription in Go?

go,redis,redigo

Yes, using a label and a loop is standard practice for reconnecting. The only thing you're missing is closing the connection. psc.Close() break ReceiveLoop For a little more resilience, you may want redis.DialTimeout so that a Dial call can't hang indefinitely....

Inadequate RAM usage by Redis

python,memory,go,redis,redigo

You have lots and lots of small HASH objects, and that's fine. But each of them has a lot of overhead in the redis memory, since it has a separate dictionary. There is a small optimization for this that usually improves things significantly, and it's to keep hashes in a...