Giter Club home page Giter Club logo

ipc-performance-compare's Introduction

IPC-performance-compare

Compare performance of IPC(Inter-Process Communication), include file, zeromq, socket, unixsocket, share-memory, msq-queue and so on

后续会把代码重新整理

在项目中,经常会遇到单机上进程间的通信,常用的进程间通信方式一般有以下几种

1 socket

2 unixsocket

3 共享内存(share-memory)

4 管道(pipe)

5 消息队列(message-queue)

6 文件(file)

7 消息总线(比如zeromq)

8 其他中间件(比如redis, memchache, 数据库等)

如果项目仅仅是消息的传递,对性能要求不高,则以上每种方式都可以实现进程间通信,我们可以选择较容易实现的方式来运用。

如果项目对消息传递性能要求很高,则我们可能会选用unixsocket,file,或者socket等, 具体哪种方式是最快的,性能最好的,则可能不太清楚。

所以,近日针对项目需要高性能的进程间通信需求,对几种通信方式的性能进行了比较,结论如下:

性能综合排序结果为(从好到差) 0 share-memory(采用信号量进行同步控制,共享内存性能最好) 1 zmq 2 file(no flush) 3 msgqueue 4 unixsocket 5 pipe 6 socket 7 file(flush) 测试方式为:把一定量的数据从服务器端发出,客户端进行接收,最后比较总耗时,并计算每秒能够处理的记录数。

ipc-performance-compare's People

Contributors

zhiyuan2007 avatar

Watchers

James Cloos avatar Ethan Feng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.