Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net.core.dev_weight monitor #15

Open
daliang111 opened this issue May 28, 2024 · 3 comments
Open

net.core.dev_weight monitor #15

daliang111 opened this issue May 28, 2024 · 3 comments

Comments

@daliang111
Copy link

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)) {
/

* Ordered by possible occurrence: Postpone processing if
* 1. we've exceeded packet quota
* 2. another process needs the CPU; */
quota -= packets;
if (quota <= 0 || need_resched()) { //quota is <=0, next softirq and break
__netif_schedule(q);
break;
}
}
}

@zersh01
Copy link
Contributor

zersh01 commented May 28, 2024

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.

@daliang111
Copy link
Author

daliang111 commented May 29, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants