Performance comparison of inter-process communication IPC in Linux under different methods

Source: Internet
Author: User

In the project, often encounter on-machine communication between processes, commonly used inter-process communication methods generally have the following

1 socket

2 Unixsocket

3 Shared Memory (share-memory)

4 Piping (pipe)

5 Message Queuing (message-queue)

6 Files (file)

7 message bus (e.g. ZEROMQ)

8 other middleware (such as Redis, Memchache, database, etc.)

If the project is simply a message delivery, the performance requirements are not high, then each of these methods can achieve interprocess communication, we can choose a more easily implemented way to apply.

If the project has a high demand for messaging performance, then we may choose Unixsocket,file, or sockets, which are the quickest and best performing, and may not be very clear.

Therefore, recently, for the project needs high-performance inter-process communication requirements, several modes of communication performance comparison, the conclusion is as follows:

Performance synthesis sorting results (from good to Bad)
1 Zmq
2 File (no flush)
3 Msgqueue
4 Unixsocket
5 Pipe
6 Socket
7 File (flush)
8 Share-memory

The test method is: Send a certain amount of data from the server side, the client receives, the final comparison is total time consuming, and calculates the number of records that can be processed per second.

The specific performance data is as follows:



Write:




How to compare inter-process communication IPC in Linux performance comparison

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.