Message Queuing Redis vs NSQ

Source: Internet
Author: User

In order to solve the problem of blocking caused by high concurrency, the problem is usually solved by Message Queuing.

A recent study of the NSQ framework for the next Golang Message Queue (HTTP/ Nsq.io), but also hands-on to achieve such a function: through the NSQ producer mass production messages to nsq push to form a message queue, and then through the nsq of consumers from the message queue to receive messages, and then use WebSocket will receive messages to all Web clients for message push. This allows all clients to receive messages that are broadcast by the server.

Redis is a NoSQL database, and because Redis is writing data to memory, Redis processing is very fast. The message queue can also be processed through Redis, so it compares the throughput and execution efficiency of Redis and NSQ processing Message Queuing.

Message Queuing execution efficiency and throughput testing methods:
Redis
Producer: Lpush key value//Insert data to the table header of the linked list named key value
Consumer: Brpop Key 0//block popup an element from the footer of a linked list named key
NSQD:
Producer: Publish (topic, MSG)//Send message to NSQD message queue that the subject is topic content MSG
Consumer: AddHandler (HANDLE)//register handle, receive Message Queuing messages in handle

Test 1 (Intranet + send small data message):

Test 2 (Intranet + send big Data message):

Conditions are limited and there is no test when Redis and NSQ servers are in the extranet. This is really necessary because Redis is heard to hear a lot slower when it is deployed in an external network.

Message Queuing Redis vs NSQ

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.