Talking about the difference between RPC and HTTP

The difference between RPC and HTTP

The 7-layer network protocol is shown in the figure. The
Insert picture description here
hierarchical relationship and the corresponding protocol. The
Insert picture description heredifference as shown in the figure :

  1. RPC is a transport layer protocol (layer 4), while the HTTP protocol is an application layer protocol (layer 7).
  2. The RPC protocol can directly call the neutral interface, but the HTTP protocol cannot.
  3. The RPC communication protocol is a long link, and the HTTP protocol generally uses a short connection to require a 3-way handshake (you can configure a long link to add the request header Keep-Alive: timeout=20).
    (Long connection means that multiple data packets can be sent continuously on a connection , During the connection hold period, if no data packets are sent, both parties need to send link detection packets.)
  4. The RPC protocol transfers data through encryption and compression. The HTTP protocol needs to transfer a large amount of request header information.
  5. The RPC protocol generally has a registry and has a rich monitoring mechanism.

Guess you like

Origin blog.csdn.net/qianzhitu/article/details/108624141