Redis: how (or should) I delete pubsub channels

10,197

Channels are ambient. They only exist while there are subscriptions. So: either call [P]UNSUBSCRIBE from the connections that subscribed, or close the connections that subscribed.

Share:
10,197
destan
Author by

destan

A full stack web developer with focus on Spring Boot/MVC, microservices and React Works at Kod Gemisi, a software company in Izmir/Turkey

Updated on June 05, 2022

Comments

  • destan
    destan almost 2 years

    In my app I dynamically create new pubsub channels and there might be too many like 5k per day. According to my app's requirements any channel is used for at most 5minutes.

    Considering this situation, thousands of unused channels will be present in the app in a week. So how can I delete unused channels or should I even delete them. Do they stored in memory? What happens to the messages published via them, do they stay on the redis' memory?

    thanks

  • destan
    destan almost 11 years
    thanks for the answer, can you specify any source to indicate that? I couldn't find such detail in the docs.
  • Marc Gravell
    Marc Gravell almost 11 years
    @destan you could measure "info stats" before and after (which describes the subscription counts) - close enough? Or you could read the source? But basically I know "by speaking to the authors" - lo tech I'm afraid