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