2.6. パケットドロップの原因
キューがいっぱいになると、通常はキューが十分に速く排出されないときに、パケットがドロップされます。ボトルネックは、キューが十分に速く排出されていないときにキューを排出することになっているエンティティーです。ほとんどの場合、ドロップカウンターは、ドロップされたパケットを追跡するために使用されます。ハードウェアまたはソフトウェアの設計にバグがあると、パケットがドロップカウンターをスキップすることがあります。
データプラン開発キット (DPDK) には、パケットを転送するための testpmd
アプリケーションが含まれています。本章のシナリオでは、testpmd
が仮想マシンにインストールされ、割り当てられた論理コア(lcores)でポートをポーリングして、あるポートから別のポートにパケットを転送します。testpmd
は、物理的仮想物理(PVP)パス全体でスループットをテストするために、トラフィックジェネレーターと共に使用します。
2.6.1. OVS-DPDK が遅すぎて物理 NIC をドレインできない
この例は、PMD スレッドが物理ネットワークアダプター (dpdk0) の受信 (RX) キューのポーリングを担当していることを示しています。PMD スレッドがパケット量に追いつかない場合、または中断された場合、パケットがドロップされる可能性があります。
図2.1 物理アダプター RX キューのポーリング
次のコマンドは、dpdk0 インターフェイスからの統計を表示します。ovs-dpdk が物理アダプターを十分な速度で排出していないためにパケットがドロップされている場合は、rx_dropped
の値が急速に増加していることがわかります。
PMD の NUMA ノードごとに物理 CPU コアは 1 つだけにする必要があります。
# ovs-vsctl --column statistics list interface dpdk0 statistics : {mac_local_errors=0, mac_remote_errors=0, "rx_1024_to_1522_packets"=26, "rx_128_to_255_packets"=243, "rx_1523_to_max_packets"=0, "rx_1_to_64_packets"=102602, "rx_256_to_511_packets"=6100, "rx_512_to_1023_packets"=27, "rx_65_to_127_packets"=16488, rx_broadcast_packets=2751, rx_bytes=7718218, rx_crc_errors=0, rx_dropped=0, rx_errors=0, rx_fragmented_errors=0, rx_illegal_byte_errors=0, rx_jabber_errors=0, rx_length_errors=0, rx_mac_short_dropped=0, rx_mbuf_allocation_errors=0, rx_oversize_errors=0, rx_packets=125486, rx_undersized_errors=0, "tx_1024_to_1522_packets"=63, "tx_128_to_255_packets"=319, "tx_1523_to_max_packets"=0, "tx_1_to_64_packets"=1053, "tx_256_to_511_packets"=50, "tx_512_to_1023_packets"=68, "tx_65_to_127_packets"=7732, tx_broadcast_packets=12, tx_bytes=466813, tx_dropped=0, tx_errors=0, tx_link_down_dropped=0, tx_multicast_packets=5642, tx_packets=9285}
2.6.2. VM が遅すぎて vhost-user をドレインできない
この例は、図 2.1 の例と似ており、インスタンス受信 (RX) キューに送信されたパケットボリュームによって lcore スレッドが圧倒されると、パケット損失が発生する可能性があります。
詳細については、次の記事を参照してください。
図2.2 仮想アダプター RX キューのポーリング
ホストの tx_dropped
値が VM の rx_dropped
値に対応するかどうかを確認するには、次のコマンドを実行します。
ovs-vsctl --column statistics list interface vhud8ada965-ce statistics : {"rx_1024_to_1522_packets"=0, "rx_128_to_255_packets"=0, "rx_1523_to_max_packets"=0, "rx_1_to_64_packets"=0, "rx_256_to_511_packets"=0, "rx_512_to_1023_packets"=0, "rx_65_to_127_packets"=0, rx_bytes=0, rx_dropped=0, rx_errors=0, rx_packets=0, tx_bytes=0, tx_dropped=0, tx_packets=0}
2.6.3. OVS-DPDK が遅すぎて vhost-user をドレインできない
この例では、PMD スレッドは、ホストの観点から受信キューである virtio TX をポーリングします。PMD スレッドがパケット量に圧倒されたり、中断されたりすると、パケットがドロップする可能性があります。
図2.3 仮想アダプターの TX キューのポーリング
VM からのパケットのリターンパスをトレースし、ホスト (tx_dropped
) 側と VM(rx_dropped
) 側の両方のドロップカウンターからの値を提供し、次のコマンドを実行します。
ovs-vsctl --column statistics list interface vhue5146cdf-aa
statistics : {"rx_1024_to_1522_packets"=0, "rx_128_to_255_packets"=0, "rx_1523_to_max_packets"=0,
"rx_1_to_64_packets"=0, "rx_256_to_511_packets"=0, "rx_512_to_1023_packets"=0, "rx_65_to_127_packets"=0,
rx_bytes=0, rx_dropped=0, rx_errors=0, rx_packets=0, tx_bytes=0, tx_dropped=0, tx_packets=0}
2.6.4. 出力物理インターフェイスでのパケット損失
PCIe と RAM の間の転送速度が遅いと、物理アダプターが TX キューからパケットをドロップする可能性があります。これはまれですが、この問題を特定して解決する方法を知ることが重要です。
図2.4 物理アダプター TX キューのポーリング
次のコマンドは、dpdk1 インターフェイスからの統計を表示します。tx_dropped
がゼロより大きく、急速に増加している場合は、Red Hat でサポートケースを開きます。
ovs-vsctl --column statistics list interface dpdk1
statistics : {mac_local_errors=0, mac_remote_errors=0, "rx_1024_to_1522_packets"=26,
"rx_128_to_255_packets"=243, "rx_1523_to_max_packets"=0, "rx_1_to_64_packets"=102602, "rx_256_to_511_packets"=6100,
"rx_512_to_1023_packets"=27, "rx_65_to_127_packets"=16488, rx_broadcast_packets=2751, rx_bytes=7718218,
rx_crc_errors=0, rx_dropped=0, rx_errors=0, rx_fragmented_errors=0, rx_illegal_byte_errors=0, rx_jabber_errors=0,
rx_length_errors=0, rx_mac_short_dropped=0, rx_mbuf_allocation_errors=0, rx_oversize_errors=0, rx_packets=125486,
rx_undersized_errors=0, "tx_1024_to_1522_packets"=63, "tx_128_to_255_packets"=319, "tx_1523_to_max_packets"=0,
"tx_1_to_64_packets"=1053, "tx_256_to_511_packets"=50, "tx_512_to_1023_packets"=68, "tx_65_to_127_packets"=7732,
tx_broadcast_packets=12, tx_bytes=466813, tx_dropped=0, tx_errors=0, tx_link_down_dropped=0,
tx_multicast_packets=5642, tx_packets=9285}
これらのタイプのパケット損失が発生した場合は、メモリーチャネルの再設定を検討してください。
- メモリーチャネルを計算するには、ネットワーク機能 仮想化(NFV)のプランニングおよび調整ガイドの メモリーパラメーター を参照して ください。
- メモリーチャネルの数を確認するには、How to determine the number of the memory channels for NeutronDpdkMemoryChannels or OvsDpdkMemoryChannels in Red Hat OpenStack Platform を参照してください。