redis--Publish subscription Mode & virtual memory

Source: Internet
Author: User
Tags redis server

First, publish the subscription message

A publish Subscription (PUB/SUB) is a message communication pattern that is primarily designed to decouple the coupling between a message publisher and a subscriber, and Redis acts as a pub/sub server, with the ability to route messages between subscribers and publishers. Subscribers can subscribe to Redis server for the type of message they are interested in by using the Subscribe and Psubscribe commands, and Redis is calling the information type Channel. When a publisher sends a specific type of information to Redis server through the Publish command, all clients subscribing to that type of information receive this message.

Example

First, the client 1 subscribes to channel TV1, client 2 subscribes to channel TV2, and the host sends a message to two channels TV1 and TV2 respectively:


  


Client 1 also receives a message sent to TV1, such as:


  


Client 2 also receives messages sent to TV1 and TV2, such as:


  


second, virtual memory

Redis's virtual memory is not the same as the operating system's virtual memory, but the idea and purpose are the same. is to temporarily swap infrequently accessed data from memory to disk , freeing up valuable memory for other data that needs to be accessed. Especially for memory databases such as Redis, memory is never enough. In addition to splitting the data into multiple Redis 5erver. Another way to improve database capacity is to use virtual memory to swap infrequently accessed data to disk.

Configuration

Configuration is simple, open the configuration file to modify the value of the VM properties, such as:


  

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

redis--Publish subscription Mode & virtual memory

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.