Redis Single Thread Issues

Source: Internet
Author: User

What single threaded 1.redis is a single thread?
Only one client connection is processed at the same point in time, which is a single thread of the Redis network module.

Why 2.redis is designed as a single thread
Specific author How to think that I don't know I say I understand
(1) Non-blocking IO for Redis, nonblocking I/O can be a single-threaded process for multiple requests
(2) If using multithreading, it is necessary to consider the context of the thread switch, and lock request and release, these operations are also more time-consuming, lock waiting more easily to the business thread pool full
(3) In my opinion, the design concept of Redis is fast track approach, in the case of full memory calculation, can serial, in processing socket request this block uses non-blocking IO, and is pure memory operation, an event loop (Request event) down, almost no waiting point

3.redis is a single thread why so fast
(1) Pure memory operation
(2) Asynchronous non-blocking I/O
(3) Single thread, avoids context switch and lock

4. Three major killers of service energy
(1) Thread switching overhead caused by a large number of threads
(2) Request and release lock
(3) Non-essential memory copy

Redis Single Thread Issues

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.