Monitoring – the xlio_stats Utility
Networking applications open various types of sockets.
The XLIO library holds the following counters:
- Per socket state and performance counters
- Internal performance counters which accumulate information for select(), poll() and epoll_wait() usage by the whole application. An additional performance counter logs the CPU usage of XLIO during select(), poll(), or epoll_wait() calls. XLIO calculates this counter only if XLIO_CPU_USAGE_STATS parameter is enabled, otherwise this counter is not in use and displays the default value as zero.
- XLIO internal CQ performance counters
- XLIO internal RING performance counters
- XLIO internal Buffer Pool performance counters
Use the included xlio_stats utility to view the per-socket information and performance counters during runtime.
Note: For TCP connections, xlio_stats shows only offloaded traffic, and not "os traffic."
The following table lists the basic and additional xlio_stats utility options.
Shows XLIO statistics for a process with pid: <pid>.
Sets shared memory directory path to <directory>
Shows XLIO statistics for application: <application>
Finds PID and shows statistics for the XLIO instance running (default).
When you set this flag to inactive, shared objects (files) are not removed.
Prints a report every <n> seconds.
Default: 1 sec
Do <n> report print cycles and exit, use 0 value for infinite.
Sets the view type:
1. Shows the runtime basic performance counters (default).
2. Shows extra performance counters.
3. Shows additional application runtime configuration information.
4. Shows multicast group membership information.
Shows netstat like view of all sockets.
Sets the details mode:
1. Show totals (default).
Dumps statistics for fd number <fd> using log level <level>. Use 0 value for all open fds.
Sets the XLIO log level to <level> (1 <= level <= 7).
Sets the XLIO log detail level to <level> (0 <= level <= 3).
Logs only sockets that match <list> or <range> format: 4-16 or 1,9 (or combination).
Prints the version number.
Prints a help message.
The following sections contain examples of the xlio_stats utility.
The following example demonstrates basic use of the xlio_stats utility.
If there is only a single process running over XLIO, it is not necessary to use the –p option, since xlio_stats will automatically recognize the process.
If no process with a suitable pid is running over the XLIO, the output is:
If an appropriate process was found, the output is:
- A single socket with user fd=14 was created
- Received 140479898 packets, 274374 Kilobytes via the socket
- Transmitted 140479898 packets, 274374 Kilobytes via the socket
- All the traffic was offloaded. No packets were transmitted or received via the OS.
- There were no missed Rx polls (see XLIO_RX_POLL). This implies that the receiving thread did not enter a blocked state, and therefore there was no context switch to hurt latency.
- There are no transmission or reception errors on this socket
xlio_stats presents not only cumulative statistics, but also enables you to view deltas of XLIO counter updates. This example demonstrates the use of the "deltas" mode.
- Three sockets were created (fds: 15, 19, and 23)
- Received 15186 packets, 29 Kilobytes during the last second via fds: 15 and 19
- Transmitted 15186 packets, 29 Kbytes during the last second via fds: 15 and 19
- Not all the traffic was offloaded, as fd 23: 15185 packets, 22 KBytes were transmitted and received via the OS. This means that fd 23 was used for unicast traffic.
- No transmission or reception errors were detected on any socket
- The application used select for I/O multiplexing
- 45557 packets were placed in socket ready queues (over the course of the last second): 30372 of them offloaded (15186 via fd 15 and 15186 via fd 19), and 15185 were received via the OS (through fd 23)
- There were no missed Select polls (see XLIO_SELECT_POLL). This implies that the receiving thread did not enter a blocked state. Thus, there was no context switch to hurt latency.
- The CPU usage in the select call is 70%
You can use this information to calculate the division of CPU usage between XLIO and the application. For example when the CPU usage is 100%, 70% is used by XLIO for polling the hardware, and the remaining 30% is used for processing the data by the application.
This example presents the most detailed xlio_stats output.
- A single socket with user fd=14 was created
- The socket is a member of multicast group: 22.214.171.124
- Received 786133 packets, 1128530 Kilobytes via the socket during the last second
- No transmitted data
- All the traffic was offloaded. No packets were transmitted or received via the OS
- There were almost no missed Rx polls (see XLIO_RX_POLL)
- There were no transmission or reception errors on this socket
- The sockets receive buffer size is 16777216 Bytes
- There were no dropped packets caused by the socket receive buffer limit (see XLIO_RX_BYTES_MIN)
- Currently, one packet of 1470 Bytes is located in the socket receive queue
- The maximum number of packets ever located, simultaneously, in the sockets receive queue is 16
- No packets were dropped by the CQ
- No packets in the CQ ready queue (packets which were drained from the CQ and are waiting to be processed by the upper layers)
- The maximum number of packets drained from the CQ during a single drain cycle is 511 (see XLIO_CQ_DRAIN_WCE_MAX)
- The RING_ETH received 786133 packets during this period
- The RING_ETH received 1192953 kilo bytes during this period. This includes headers bytes.
- 786137 interrupts were requested by the ring during this period
- 78613 interrupts were intercepted by the ring during this period
- The moderation engine was set to trigger an interrupt for every 10 packets and with maximum time of 181 usecs
- There were no retransmissions
- The current available buffers in the RX pool is 168000
- The current available buffers in the TX pool is 199488
- There were no buffer requests that failed (no buffer errors)
This example demonstrates how you can get multicast group membership information via xlio_stats.
This is an example of the “netstat like” view of xlio_stats (-v 5).
- Two processes are running XLIO
- PID 1576 has one UDP socket bounded to all interfaces on port 44522
- PID 1618 has one TCP listener socket bounded to all interfaces on port 11111
This is an example of a log of socket performance counters along with an explanation of the results (using XLIO_STATS_FILE parameter).
- No transmission or reception errors occurred on this socket (user fd=10).
- All the traffic was offloaded. No packets were transmitted or received via the OS.
- There were practically no missed Rx polls (see XLIO_RX_POLL and XLIO_SELECT_POLL). This implies that the receiving thread did not enter a blocked state. Thus, there was no context switch to hurt latency.
- There were no dropped packets caused by the socket receive buffer limit (see XLIO_RX_BYTES_MIN). A single socket with user fd=14 was created.
This is an example of xlio_stats fd dump utility of established TCP socket using log level = info.
- Fd 17 is a descriptor of established TCP socket (126.96.36.199:58795 -> 188.8.131.52:6666)
- Fd 17 is offloaded by XLIO
- The current usage of the receive buffer is 0 bytes, while the max possible is 87380
- The connection (PCB) flags are TF_WND_SCALE and TF_NODELAY (PCB0x140)
- Window scaling is enabled, receive and send scales equal 7
- Congestion windows equal 1662014
- Unsent queue is empty
- There is a single packet of 14 bytes in the un-acked queue (seqno 12678066)
- The last acknowledge sequence number is 12678066
Use the XLIO logs in order to trace XLIO operations. XLIO logs can be controlled by the XLIO_TRACELEVEL variable. This variable's default value is 3, meaning that the only logs obtained are those with severity of PANIC, ERROR, and WARNING.
You can increase the XLIO_TRACELEVEL variable value up to 6 (as described in XLIO Configuration Parameters to see more information about each thread's operation. Use the XLIO_LOG_DETAILS=3 to add a time stamp to each log line. This can help to check the time difference between different events written to the log.
Use the XLIO_LOG_FILE=/tmp/my_file.log to save the daily events. It is recommended to check these logs for any XLIO WARNINGs and errors. Refer to the Troubleshooting section to help resolve the different issues in the log.
XLIO will replace a single '%d' appearing in the log file name with the pid of the process loaded with XLIO. This can help in running multiple instances of XLIO each with its own log file name.
When XLIO_LOG_COLORS is enabled, XLIO uses a color scheme when logging: Red for errors and warnings, and dim for low level debugs.
Use the XLIO_HANDLE_SIGSEGV to print a backtrace if a segmentation fault occurs.
Look at the Ethernet counters (by using the ifconfig command) to understand whether the traffic is passing through the kernel or through the XLIO (Rx and Tx).
For tcpdump to capture offloaded traffic, please follow instructions in section Offloaded Traffic Sniffer in the MLNX_OFED User Manual.
Look at the NIC counters to monitor HW interface level packets received and sent, drops, errors, and other useful information.
Peer Notification Service
Peer notification service handles TCP half-open connections where one side discovers the connection was lost but the other side still see it as active.
The peer-notification daemon is started at system initialization or manually under super user permissions.
The daemon collects information about TCP connections from all the running XLIO processes. Upon XLIO process termination (identified as causing TCP half open connection) the daemon notifies the peers (by sending Reset packets) in order to let them delete the TCP connections on their side.
This section lists problems that can occur when using XLIO, and describes solutions for these problems.
High Log Level
This warning message indicates that you are using XLIO with a high log level.
The XLIO_TRACELEVEL variable value is set to 4 or more, which is good for troubleshooting but not for live runs or performance measurements.
Solution: Set XLIO_TRACELEVEL to its default value 3.
2. On running an application with XLIO, the following error is reported:
Solution: Check that libxlio is properly installed, and that libxlio.so is located in /usr/lib (or in /usr/lib64, for 64-bit machines).
3. On attempting to install libxlio rpm, the following error is reported:
Solution: Install the rpm with privileged user (root).
4. The following warning is reported:
Solution: When working with root, increase the maximum locked memory to 'unlimited' by using the following command:
When working as a non-privileged user, ask your administrator to increase the maximum locked memory to unlimited.
5. Lack of huge page resources in the system. The following warning is reported:
This warning message means that you are using XLIO with huge page memory allocation enabled (XLIO_MEM_ALLOC_TYPE=2), but not enough huge page resources are available in the system. XLIO will use contiguous pages instead.
Note that XLIO_MEM_ALLOC_TYPE= 1 is not supported while working with Microsoft hypervisor. In this case – please use XLIO_MEM_ALLOC_TYPE= 0 (malloc).
If you want XLIO to take full advantage of the performance benefits of huge pages, restart the application after adding more huge page resources to your system similar to the details in the warning message above, or try to free unused huge page shared memory segments with the script below.
If you are running multiple instances of your application loaded with XLIO, you will probably need to increase the values used in the above example.
Check that your host machine has enough free memory after allocating the huge page resources for XLIO. Low system memory resources may cause your system to hang.
Use "ipcs -m" and "ipcrm -m shmid" to check and clean unused shared memory segments.
Use the following script to release XLIO unused huge page resources:
6. Wrong ARP resolution when multiple ports are on the same network.
When two (or more) ports are configured on the same network (e.g. 192.168.1.1/24 and 192.168.1.2/24) XLIO will only detect the MAC address of one of the interfaces. This will result in incorrect ARP resolution.
This is due to the way Linux handles ARP responses in this configuration. By default, Linux returns the same MAC address for both IPs. This behavior is called “ARP Flux”.
To fix this, it is required to change some of the interface’s settings:
To verify the issue is resolved, clear the ARP tables on a different server that is on the same network and use the arping utility to verify that each IP reports its own MAC address correctly:
7. XLIO process cannot establish connection with daemon (xliod) in Microsoft hypervisor environment.
When working with Microsoft Hypervisor, XLIO daemon must be enabled in order to submit Traffic Control (TC) rules which will offload the traffic to the TAP device in case of plug-out events.
The following warning is reported during XLIO startup:
The following warning is reported during any connection establishment/termination:
To fix this, run “xliod” as root.
8. Device memory programming is not supported on VMs that lack Blue Flame support.
XLIO will explicitly disable Device Memory capability if it detects Blue Flame support is missing on the node on which user application was launched using XLIO. The following warning message will appear: