For more information, see vloveiyhttp: // ffown.sinaapp.com /? P = 40
CPU name: Intel (r) Xeon (r) CPU e5405 @ 2.00 GHz
Processor: 4
CPU MHz: 1995.021
IPC latency:
IPC type: messagesize: average latency:
UNIX socket 10 k 9us
Localhost TCP 10 k 11us
Pipe 10 k 6us
Remote TCP 10 k 13us
IPC throughput:
IPC type: messagesize: average throughput/MSG: average throughput/m:
UNIX socket 10 k 183049 MSG/s 14643 MB/S
Localhost TCP 10 k 113901 MSG/s 9112 MB/S
Pipe 10 k 146724 MSG/s 11737 MB/S
TestCode:
Http://github.com/rigtorp/ipc-bench
In Linux, I want to select an IPC, which tends to be UNIX socket and tested by IPC-plugin.
It seems that the latency of 10 k Data Transmission 9us is acceptable in most applications,
In this way, some applications can use a multi-process mode similar to nginx, with a process at the network layer,
Multi-process in the logic layer, and can run scripts. It can utilize the synchronous writing logic to give full play to the advantages of multiple cores.