The difference between RPC and HTTP
The 7-layer network protocol is shown in the figure. The
hierarchical relationship and the corresponding protocol. The
difference as shown in the figure :
- RPC is a transport layer protocol (layer 4), while the HTTP protocol is an application layer protocol (layer 7).
- The RPC protocol can directly call the neutral interface, but the HTTP protocol cannot.
- 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.) - The RPC protocol transfers data through encryption and compression. The HTTP protocol needs to transfer a large amount of request header information.
- The RPC protocol generally has a registry and has a rich monitoring mechanism.