Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Implementation method for highly concurrent message queues

A technology of message queue and implementation method, applied in the direction of resource allocation, inter-program communication, instruments, etc., can solve the problems of message queue unable to carry, large concurrency, etc., to avoid the reduction of robustness, improve the response speed, and reduce the system The effect of resource consumption

Inactive Publication Date: 2018-09-28
广州市巨硅信息科技有限公司
View PDF10 Cites 18 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0008] The technical problem to be solved by the present invention is that the existing message queue cannot carry a large amount of concurrency, the consumer needs to wait for the return result after pushing the message to the message queue, and needs to create a worker thread to execute the content of the message when fetching the message from the message queue

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Implementation method for highly concurrent message queues
  • Implementation method for highly concurrent message queues
  • Implementation method for highly concurrent message queues

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0029] In the server mode, if the data is requested in time, if the data is returned synchronously, the throughput TPS of the server should satisfy the following equation:

[0030] QPS=min{CPU, memory, external interface, IO operation};

[0031] In order to satisfy the above equation, the present invention designs a set of solutions, which decomposes a large task into small tasks one by one through the internal components of the server, realizes data decoupling, and performs asynchronous and concurrent processing of each small task, thereby improving server performance. Throughput TPS, the throughput TPS of the designed server satisfies the following equation:

[0032] QPS=max{min{CPU, memory}, min{external interface, IO operation}};

[0033] Because, min{CPU, memory}>min{external interface, IO operation};

[0034] Therefore, QPS=min{CPU, memory};

[0035] Visible, the performance of the present invention depends on the bottleneck of CPU or internal memory, because the proc...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses an implementation method for highly concurrent message queues. The method comprises the steps of creating a doubly linked list of an FIFO (First Input First Output) as a globalmessage queue, and a message queue thread corresponding to the global message queue; creating a global thread pool, wherein the global thread pool is provided with a certain amount of work threads and data source job linked lists; enabling the message queue thread to detect that messages exist in the global message queue, sequentially taking out each message from an egress of the global message queue to generate jobs, inserting the jobs into the data source job linked list of the global thread pool, and then broadcasting the work threads; and enabling different work threads of the global thread pool to respectively take out one job from the data source job linked list, executing callback functions of the corresponding messages according to types of the jobs to perform corresponding business processing, and respectively returning processing results to corresponding clients after completion of the execution. According to the implementation method for the highly concurrent message queues, a relatively large data request concurrent amount can be borne; after pushing the messages to the message queues, a consumer does not need to wait for return results; the response speed is improved;and the consumption of system resources is reduced.

Description

technical field [0001] The invention relates to computer communication technology, in particular to a method for realizing a high concurrent message queue. Background technique [0002] Message Queue (Message Queue, MQ) is a communication method between applications. Messages can be returned immediately after sending. The message system ensures the reliable delivery of messages. The message publisher only publishes the message to MQ and does not care who will Fetch, message users only get messages from MQ regardless of who publishes them. [0003] MQ is often used in scenarios such as business decoupling, eventual consistency, broadcasting, and off-peak flow control. For example, as the business develops and the order volume increases, the performance of system services needs to be improved. At this time, some services that do not need to take effect immediately Operations are split and executed asynchronously, such as sending red envelopes, sending SMS notifications, etc. ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F9/54G06F9/50
CPCG06F9/5027G06F9/5061G06F9/542G06F9/546G06F2209/5017G06F2209/5018G06F2209/508G06F2209/548
Inventor 王毅群赵娅利蔡文方金石魏建平
Owner 广州市巨硅信息科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products