How Redis Virtual memory works

Source: Internet
Author: User


4.3.1. When Vm-max-threads is set to 0 o'clock (blocking mode)
Swap out
After the main thread periodically checks that the memory exceeds the maximum limit, the selected object is saved to swap directly in a blocking manner.
File, and frees the memory space that the object occupies, this process repeats until the following conditions are met
1. Memory usage drops below maximum limit
The 2.swap file is full.
3. Almost all of the objects have been swapped to disk.
Swap in
When a client requests a value that has been swapped out, the main thread loads the corresponding
The value object, which at the time of loading will block all clients. Then process the client's request
4.3.2. When Vm-max-threads is greater than 0 o'clock (working thread mode)
Swap out
When the main thread detects that more than the maximum limit is used, the object information that is selected for Exchange is placed in a queue and handed to the worker
Thread background processing, the main thread continues to process client requests.
Swap in
If a client-requested key has been swapped out, the main thread will first block the client that issued the command and then load the
Information in a queue to allow the worker to load. A worker thread notifies the main thread after loading is complete. The main thread again
Executes the command for the client. This way only blocking the requested value is the client that has been swapped out for key.
In general, the performance of blocking is better because there is no need for thread synchronization, creating threads, and recovering blocked guest
The cost of the client. But the response is also sacrificed accordingly. The working thread mode main thread does not block on disk IO,
To be more responsive. If our application doesn't happen too often, and we don't care about a bit of delay, it's recommended
Use blocking mode.

For more highlights, please follow: http://bbs.superwu.cn

Focus on Superman Academy QR Code: 650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M00/6C/B2/wKioL1VQc-_R3Vc6AADAdZasjL0046.jpg " Title= "Superman Academy. jpg" alt= "wkiol1vqc-_r3vc6aadadzasjl0046.jpg"/>

How Redis Virtual memory works

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.