doc:appunti:linux:sa:ksoftirqd
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:appunti:linux:sa:ksoftirqd [2024/11/08 16:39] – [ksoftirqd process utilizes 100% of a CPU] niccolo | doc:appunti:linux:sa:ksoftirqd [2024/11/08 17:22] (current) – [ksoftirqd process utilizes 100% of a CPU] niccolo | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| < | < | ||
| - | ps uax | grep ksoftir | + | ps uax | grep ksoftirqd |
| root 14 0.0 0.0 0 0 ? S Nov07 0:00 [ksoftirqd/ | root 14 0.0 0.0 0 0 ? S Nov07 0:00 [ksoftirqd/ | ||
| root 21 1.4 0.0 0 0 ? S Nov07 21:43 [ksoftirqd/ | root 21 1.4 0.0 0 0 ? S Nov07 21:43 [ksoftirqd/ | ||
| Line 59: | Line 59: | ||
| TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
| </ | </ | ||
| + | |||
| + | ===== softnet_stat ===== | ||
| Grazie al contenuto di **/ | Grazie al contenuto di **/ | ||
| Line 75: | Line 77: | ||
| awk '{for (i=1; i<=NF; i++) printf strtonum(" | awk '{for (i=1; i<=NF; i++) printf strtonum(" | ||
| </ | </ | ||
| + | |||
| + | ===== netdev_max_backlog ===== | ||
| Se il numero nella **seconda colonna** cresce costantemente (frame persi a causa di una coda backlog piena), è possibile incrementare la dimensione del buffer. Il valore corrente si vede con: | Se il numero nella **seconda colonna** cresce costantemente (frame persi a causa di una coda backlog piena), è possibile incrementare la dimensione del buffer. Il valore corrente si vede con: | ||
| < | < | ||
| - | # sysctl net.core.netdev_max_backlog | + | sysctl net.core.netdev_max_backlog |
| net.core.netdev_max_backlog = 1000 | net.core.netdev_max_backlog = 1000 | ||
| </ | </ | ||
| Line 95: | Line 99: | ||
| </ | </ | ||
| - | Anche la **terza colonna** se cresce costantemente può indicare un problema. In questo caso significa che il budget dedicato a gestire il traffico ricevuto è esaurito e la softirq viene rischedulata. Il budget assegnato è dato dal parametro | + | ===== netdev_budget ===== |
| + | |||
| + | Anche la **terza colonna** | ||
| + | |||
| + | Il budget assegnato è dato dai parametri | ||
| + | |||
| + | < | ||
| + | sysctl net.core.netdev_budget | ||
| + | net.core.netdev_budget = 300 | ||
| + | |||
| + | sysctl net.core.netdev_budget_usecs | ||
| + | net.core.netdev_budget_usecs = 8000 | ||
| + | </ | ||
| + | |||
| + | In questo caso softirqd ha, per ogni ciclo di polling, 8000 microsecondi di tempo massimo per processare fino a 300 messaggi dalla scheda di rete. Possiamo aumentarli creando un file **/ | ||
| + | |||
| + | < | ||
| + | net.core.netdev_budget = 600 | ||
| + | net.core.netdev_budget_usecs = 24000 | ||
| + | </ | ||
| + | |||
| + | ed eseguendo | ||
| + | |||
| + | < | ||
| + | sysctl -p / | ||
| + | </ | ||
| + | |||
| + | ===== Shorewall (netfilter) logging ===== | ||
| + | |||
| + | Purtroppo nel nostro caso **non si sono ottenuti risultati incrementando il budget** per la softirq. L'host in questione è un firewall GNU/Linux con due schede di rete, il problema era associato all' | ||
| + | |||
| + | < | ||
| + | iptables -S | wc -l | ||
| + | 157 | ||
| + | </ | ||
| + | |||
| + | Il problema si manifestava in condizioni di portscan intensi, intorno ai 3 pacchetti/ | ||
| + | Avendo **eliminato il logging dei pacchetti dropped** il problema pare risolto. | ||
| ===== Web References ===== | ===== Web References ===== | ||
| Line 102: | Line 143: | ||
| * **[[https:// | * **[[https:// | ||
| * **[[https:// | * **[[https:// | ||
| + | * **[[https:// | ||
| * **[[https:// | * **[[https:// | ||
doc/appunti/linux/sa/ksoftirqd.1731080380.txt.gz · Last modified: by niccolo
