leandromoreira / linux-network-performance-parameters

Learn where some of the network sysctl variables fit into the Linux/Kernel network flow. Translations: 🇷🇺
https://github.com/leandromoreira/linux-network-performance-parameters
BSD 3-Clause "New" or "Revised" License
5.35k stars 492 forks source link

net.core.dev_weight monitor #15

Open daliang111 opened 1 month ago

daliang111 commented 1 month ago

is there any way to monitor the dev_weight, /proc/net/softnet_stat have no info about dev_weight. like the kernel code, no way to monitor if dev_weight is to small? void __qdisc_run(struct Qdisc q){
int quota = dev_tx_weight; // max send package num int packets;
while (qdisc_restart(q, &packets)) {
/

zersh01 commented 1 month ago

dev_weight = net.core.netdev_budget

The structure of the /proc/net/softnet_stat file is typically as follows (as of the latest Linux kernel versions): 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

Each field is presented in hexadecimal format. Here's what these fields usually represent:

  1. processed: The number of processed packets.
  2. dropped: The number of packets that were dropped due to queue overflow.
  3. time_squeeze: The number of times netdev_budget was exhausted (i.e., when the number of processed packets reached the limit set by net.core.netdev_budget).
  4. cpu_collision: Collisions with other CPU processes.
  5. received_rps: The number of packets processed in the context of RPS (Receive Packet Steering).
  6. flow_limit_count: The number of times flow limit was exceeded.

The time_squeeze field is particularly important if you are interested in how often the netdev_budget is insufficient for processing all packets in the queue during one softirq call. If this value is high, it may indicate that the current net.core.netdev_budget is too low for the current load and should be increased to improve the performance of the network subsystem.

leandromoreira commented 1 month ago

https://github.com/leandromoreira/linux-network-performance-parameters?tab=readme-ov-file#interrupt-coalescing-soft-irq-and-ingress-qdisc

daliang111 commented 1 month ago

what is different between net.core.netdev_budget and net.core.dev_weight,and is any way to moniotr if dev_weight is too small ? time_squeeze is about net.core.netdev_budget ,nothing to do with net.core.dev_weight . kernel code, https://elixir.bootlin.com/linux/v5.0/source/net/core/dev.c#L6389

budget=netdev_budget if (unlikely(budget <= 0 || time_after_eq(jiffies, time_limit))) { sd->time_squeeze++; break; }

and net.core.netdev_budget(system parameter ) ---->netdev_budget(kernel code) net.core.dev_weight net.core.dev_weight_tx_bias ----> dev_tx_weight net.core.dev_weight net.core.dev_weight_rx_bias ----> dev_rx_weight

i want to monitor whether dev_weight is suitable,if dev_weight is too small ,which monitor metric can show it?