How slow are TCP sockets compared to named pipes on Windows for localhost IPC?

后端 未结 6 870
广开言路
广开言路 2020-12-02 11:33

I am developing a TCP Proxy to be put in front of a TCP service that should handle between 500 and 1000 active connections from the wild Internet.

The proxy is runn

6条回答
  •  北海茫月
    2020-12-02 12:04

    For anyone that comes to read this later, I want to add some findings that answer the original question.

    For a utility we are developing we have a networking class that can use named pipes, or TCP with the same calls.

    Here is a typical loop back file transfer on our test system:

    TCP/IP Transfer time: 2.5 Seconds
    Named Pipes Transfer time: 3.1 Seconds

    Now, if you go outside the machine and connect to a remote computer on your network the performance for named pipes is much worse:

    TCP/IP Transfer time: 12 Seconds
    Named Pipes Transfer time: 2.5 Minutes (Yes Minutes!)

    I realize that this is just one system (Windows 7) But I think it is a good indicator of how slow named pipes can be...and it seems like TCP is the way to go.

提交回复
热议问题