RSS는 Receive Side Scaling의 약자로 수신된 Packet을 Processing 하는 Processor가 한 개로 제한된 상태라,
Network Throughput이 하나의 Processor가 처리할 수 있는 양으로 제한되는 성능 상의 문제를 개선하기 위해 도입된 기능입니다.
RSS를 활성화하게 되면, 여러 개의 Processor가 Network 수신 시 발생하는 Interrupt를 처리할 수 있게 됩니다.
Network Driver 마다 다를 수 있겠지만, Intel의 ixgben Driver에서는 아래 3가지의 RSS 모드를 지원합니다.
아래 표시된대로 기존에는 NetQueue RSS만 있었던 것으로 보이나, Device RSS와 DefaultQueue RSS가 추가된 것으로 확인됩니다.
- Device RSS(new added), 16 hardware queues per RSS engine.
- NetQueue RSS, 4 hardware queues per RSS engine, no change.
- DefaultQueue RSS(new added), 4 hardware queues per RSS engine.
동시에 하나의 RSS 모드만 사용 가능하며, 위 3개의 RSS 모드가 모두 활성화 되어 있는 경우에는 Device RSS > NetQueue RSS > DefaultQueue RSS 순으로 우선 순위를 가지게 됩니다.
만약 BUM(Broadcast, Unknown, Multicast) Traffic이 많은 경우에는 DefaultQueue RSS를 통해서 효과를 볼 수 있고, NetQueue RSS는 Unicast Traffic에만 효과를 볼 수 있다고 합니다.

이 RSS를 어떻게 활성화하는지 Intel의 ixgben Driver를 기준으로 테스트 한 내용을 공유 드립니다.
Physical NIC RSS 활성화
1. 현재 서버에 설치된 Physical NIC 확인
## NIC가 총 4개 있고, Driver는 ixgben을 사용
# esxcli network nic list Name PCI Device Driver Admin Status Link Status Speed Duplex MAC Address MTU Description ------ ------------ ------ ------------ ----------- ----- ------ ----------------- ---- ----------- vmnic0 0000:19:00.0 ixgben Up Up 10000 Full 78:ac:44:4b:b0:dc 1500 Intel(R) Ethernet Controller X550 vmnic1 0000:19:00.1 ixgben Up Up 10000 Full 78:ac:44:4b:b0:dd 1500 Intel(R) Ethernet Controller X550 vmnic2 0000:1a:00.0 ixgben Up Up 10000 Full 78:ac:44:4b:b0:de 1500 Intel(R) Ethernet Controller X550 vmnic3 0000:1a:00.1 ixgben Up Up 10000 Full 78:ac:44:4b:b0:df 1500 Intel(R) Ethernet Controller X550 |
2. 활성화 전 NIC Driver Parameter 확인
## 명시적으로 설정된 경우에는 Value Column에 값이 출력
# esxcli system module parameters list -m ixgben Name Type Value Description ------- ------------ ------- ----------- DRSS array of int DefQueue RSS state: 0 = disable, 1 = enable (default = 0; 4 queues if DRSS is enabled) DevRSS array of int Device RSS state: 0 = disable, 1 = enable (default = 0; 16 queues but all virtualization features disabled if DevRSS is enabled) QPair array of int Pair Rx & Tx Queue Interrupt: 0 = disable, 1 = enable (default) RSS array of int NetQueue RSS state: 0 = disable, 1 = enable (default = 1; 4 queues if RSS is enabled) RxITR array of int Default RX interrupt interval: 0 = disable, 1 = dynamic throttling, 2-1000 in microseconds (default = 50) TxITR array of int Default TX interrupt interval: 0 = disable, 1 = dynamic throttling, 2-1000 in microseconds (default = 100) VMDQ array of int Number of Virtual Machine Device Queues: 0/1 = disable, 2-16 enable (default = 8) max_vfs array of int Maximum number of VFs to be enabled (0..63) |
3. 활성화 후 NIC Parameter 확인
## 활성화 할 때, RSS=1,1,1,1 의 의미는 vmnic0, vmnic1, vmnic2, vmnic3 를 모두 활성화 한다는 의미
## 활성화 할 필요가 없는 NIC의 경우에는 1대신 0을 사용
## 정확히 하면 이러한 가이드는 Vendor마다 다를 수 있기 때문에 esxcli system module parameters list -m <module name> 으로 조회한 결과에 따라서 다르게 적용할 필요가 있음
# esxcli system module parameters set -m ixgben -p "RSS=1,1,1,1" # esxcli system module parameters list -m ixgben Name Type Value Description ------- ------------ ------- ----------- DRSS array of int DefQueue RSS state: 0 = disable, 1 = enable (default = 0; 4 queues if DRSS is enabled) DevRSS array of int Device RSS state: 0 = disable, 1 = enable (default = 0; 16 queues but all virtualization features disabled if DevRSS is enabled) QPair array of int Pair Rx & Tx Queue Interrupt: 0 = disable, 1 = enable (default) RSS array of int 1,1,1,1 NetQueue RSS state: 0 = disable, 1 = enable (default = 1; 4 queues if RSS is enabled) RxITR array of int Default RX interrupt interval: 0 = disable, 1 = dynamic throttling, 2-1000 in microseconds (default = 50) TxITR array of int Default TX interrupt interval: 0 = disable, 1 = dynamic throttling, 2-1000 in microseconds (default = 100) VMDQ array of int Number of Virtual Machine Device Queues: 0/1 = disable, 2-16 enable (default = 8) max_vfs array of int Maximum number of VFs to be enabled (0..63) |
4. NIC Driver Reload
## 이 부분이 중요
## NIC Driver를 Unload하면 네트워크가 끊기게 되므로 이 작업은 DCUI를 통해서만 가능
# vmkload_mod -u ixgben Module ixgben successfully unloaded # vmkload_mod ixgben Module ixgben loaded successfully |
5. Device Manager 중지
# Device Manager를 강제로 중지하게 되면 PCI fastconnect를 Trigger하여 Device를 Scan하게 된다고 합니다.
# 이 순간에 네트워크가 다시 연결
# pkill -HUP vmkdevmgr |
6. NIC Parameter 검증
# 재부팅을 한 후에도 값이 계속 유지되는지 확인 필요
# reboot -f # esxcli system module parameters list -m ixgben Name Type Value Description ------- ------------ ------- ----------- DRSS array of int DefQueue RSS state: 0 = disable, 1 = enable (default = 0; 4 queues if DRSS is enabled) DevRSS array of int Device RSS state: 0 = disable, 1 = enable (default = 0; 16 queues but all virtualization features disabled if DevRSS is enabled) QPair array of int Pair Rx & Tx Queue Interrupt: 0 = disable, 1 = enable (default) RSS array of int 1,1,1,1 NetQueue RSS state: 0 = disable, 1 = enable (default = 1; 4 queues if RSS is enabled) RxITR array of int Default RX interrupt interval: 0 = disable, 1 = dynamic throttling, 2-1000 in microseconds (default = 50) TxITR array of int Default TX interrupt interval: 0 = disable, 1 = dynamic throttling, 2-1000 in microseconds (default = 100) VMDQ array of int Number of Virtual Machine Device Queues: 0/1 = disable, 2-16 enable (default = 8) max_vfs array of int Maximum number of VFs to be enabled (0..63) |
VMX Configuration
VMX에는 몇 가지 Configuration에 추가되어야 하며, 해당 값들의 정의는 다음과 같습니다.
1. ethernetX.pnicFeatures
# pnicFeatures 값은 4를 사용
# 4는 RSS를 의미
2. ethernetX.ctxPerDev
# ctxPerDev 값에 따라 생성되는 NetWorld 프로세스 수가 달라짐
# 대부분의 문서에는 1로 하라고 되어 있으며, 아래 문서에는 3으로 설정하는 것으로 가이드 되어 있음
ctxPerDev='2' This is the ESXi default value. This means one NetWorld process for all vNICs on the VM. TX packets, from all vNic's combined, will max out at approximately 250K PPS ctxPerDev='1' Introduced in vSphere 6.0, this value creates a NetWorld Process for each vNIC. TX traffic, on each vNic, will max out at approximately 250K PPS ctxPerDev='3' Introduced in vSphere 6.5, this value creates a NetWorld Process for each queue on each vNIC. TX traffic, on each vNic, will max out at approximately 1 million PPS. This may stress the physical NIC |
Guest OS 확인
# Windows Server 2012 R2 기준
1. RSS 활성화 확인(명령어)
PS C:\> netsh int tcp show global Querying active state... TCP Global Parameters ---------------------------------------------- Receive-Side Scaling State : enabled ### <-- !! Chimney Offload State : disabled NetDMA State : disabled Direct Cache Access (DCA) : disabled Receive Window Auto-Tuning Level : normal Add-On Congestion Control Provider : none ECN Capability : enabled RFC 1323 Timestamps : disabled Initial RTO : 3000 Receive Segment Coalescing State : enabled Non Sack Rtt Resiliency : disabled Max SYN Retransmissions : 2 |
2. RSS 활성화 확인(GUI)
시작 > 실행 > ncpa.cpl > 네트워크 어댑터 > properties > configure > advanced 탭
3. RSS 상태 확인
PS C:\> Get-NetAdapterRss Name : Ethernet0 InterfaceDescription : vmxnet3 Ethernet Adapter Enabled : True NumberOfReceiveQueues : 4 Profile : NUMAStatic BaseProcessor: [Group:Number] : 0:0 MaxProcessor: [Group:Number] : 0:3 MaxProcessors : 4 RssProcessorArray: [Group:Number/NUMA Distance] : 0:0/0 0:1/0 0:2/0 0:3/0 IndirectionTable: [Group:Number] : 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 0:0 0:1 0:2 0:3 |
다음에는 RSS가 활성화된 Guest OS로 Network Traffic이 발생할 때 Processor 별로 Interrupt가 어떻게 발생하는지에 대해서 알아보겠습니다.
'Networking' 카테고리의 다른 글
[NSX] Setup - 0. Basic Network Environment (0) | 2023.09.16 |
---|---|
nping 사용법 (0) | 2023.08.09 |
[Socket Programming #2] CLOSE_WAIT (0) | 2023.05.19 |
[Socket Programming #1] Server/Client based on TCP (0) | 2023.05.18 |
TCP 3-way handshake fails due to missing routing entry (0) | 2023.05.08 |