![]() ![]() When the socket is in the listening state (Listening), ![]() Send-Q indicates the number of bytes that have not been confirmed by the remote host (ie, the length of the sending queue).Recv-Q indicates the number of bytes in the socket buffer that have not been taken by the application (ie the length of the receive queue).When the socket is in the connected state (Established), Of course, also note that they have different meanings in different socket states. When you find that they are not 0, it means that there is accumulation of network packets. I personally recommend using ss to query network connection information, as it provides better performance (faster) than netstat.įor example, you can run the following command to query socket information: # -l means how only listen sockets # -t means show only TCP sockets # -n means display numeric address and port # -p means display process information\ $ ss -ltnp | head -n 3 State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 0.0.0.0:111 0.0.0.0:* users:(("rpcbind",pid=2646,fd=8)) LIS0.0.0.0:80 0.0.0.0:* users:(("docker-proxy",pid=3844,fd=4))Īmong the above output, the receive queue (Recv-Q) and the send queue (Send-Q) need your special attention, they should usually be 0. You can use netstat or ss to view socket, network stack, network interface and routing table information. Ip command only show the statistics of the data packets sent and received by the network interface, but in the actual performance problem, we must also pay attention to the statistics in the network protocol stack. A number of bytes, packets, errors and packet loss sent and received by the network.MTU: The maximum transmission unit (MTU) configured on the network interface specifies the maximum IP packet size.status: LOWER_UP in ip output, indicates that the physical network is connected and in use.But if you can’t find the ifconfig or ip command, you can install both packages.įor example: $ ip -s addr show dev eth0 2: eth0: mtu 9001 qdisc mq state UP group default qlen 1000 link/ether 12:08:83:db:bb:67 brd ff:ff:ff:ff:ff:ff inet 172.31.82.28/20 brd 172.31.95.255 scope global dynamic eth0 valid_lft 3209sec preferred_lft 3209sec inet6 fe80::1008:83ff:fedb:bb67/64 scope link valid_lft forever preferred_lft forever RX: bytes packets errors dropped overrun mcast 192867565 153389 0 0 0 0 TX: bytes packets errors dropped carrier collsns 5866543 55639 0 0 0 0įrom the output, there are a few indicators that you need to pay attention. Usually they are installed by default in distributions. Ifconfig and ip belong to the packages net-tools and iproute2 respectively, iproute2 is the next generation of net-tools. ip the command is preferred due to the following reason: You can use the ifconfig or ip command to view the network configuration. The first step in analyzing a network problem is usually to look at the configuration and status of the network interface. are also commonly used performance indicators. In addition to these indicators, the availability of the network (whether the network can communicate normally), the number of concurrent connections (the number of TCP connections), the packet loss rate (the percentage of packet loss), the retransmission rate (the proportion of network packets that are retransmitted), etc. PPS is usually used to evaluate the forwarding capability of a network, such as hardware switches, which can usually achieve linear forwarding (ie, PPS can reach or approach the theoretical maximum). PPS, packet per second, indicates the transmission rate in network packets.Delay, the time delay from when a network request is sent until the remote response is received.Throughput is limited by bandwidth, and throughput/bandwidth is the usage of the network. Throughput, indicating the amount of data successfully transmitted per unit time, also in b/s unit, or B/s.Bandwidth, indicating the maximum transmission rate of the link, usually in b/s (bits per second) unit.We usually measure network performance with indicators such as bandwidth, throughput, latency and packet per second (PPS). So how do you measure network performance? What tool or command should you use? Let’s take a look at useful tools and metrics for Linux network performance. When an application sends a data packet through the socket interface, it must be processed layer by layer in the network protocol stack from top to bottom, and then finally sent to the network card for sending and when receiving a data packet, it must first go through the network stack from the bottom It is processed layer by layer and finally sent to the application. The TCP/IP model consists of five layers: To recap briefly, the Linux network stack is based on the TCP/IP model. In my previous article, “ Linux - Networking Deep Dive”, I talked about basics of Linux networking.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |