Amazon recommends customers to choose VPC as it provides data center like features and performance with the elasticity of a public cloud. One of the key performance differentiator between EC2 Classic and VPC is the Enhanced Networking feature offered on VPC instances, that helps applications achieve high RPS rates due to low latency networking. As Netflix makes the migration from EC2 classic to VPC, we have executed benchmarks to identify VPC instance limits. Micro benchmarks ran on Amazon (r3,i2,m4).8xlarge VPC instances reported 10 fold (2 Mpps) improvement in packet processing rates as compared to similar EC2 classic instance, which is limited to 200 kpps. Some application benchmarks have also reported 10x higher RPS (Request/sec) rates in VPC.
Due to early adoption of public cloud, the majority of Netflix services are still hosted on Amazon EC2 Classic cloud. AWS services have evolved and EC2 classic was not built to support features required by new breed of cloud services. Netflix services, that use RPS rates as a metric to scale the ASG (Auto Scaling Group), routinely over provision compute farms to overcome packet processing overhead inherent in Xen split driver model (Figure 1).
Due to early adoption of public cloud, the majority of Netflix services are still hosted on Amazon EC2 Classic cloud. AWS services have evolved and EC2 classic was not built to support features required by new breed of cloud services. Netflix services, that use RPS rates as a metric to scale the ASG (Auto Scaling Group), routinely over provision compute farms to overcome packet processing overhead inherent in Xen split driver model (Figure 1).
Figure1. Definitive Guide to the Xen Hypervisor |
NOTE: EC2 classic instances and low end instances in VPC use Xen split driver model (software) that uses shared memory ring between instance and Dom0 (Xen trusted domain) to exchange packets. This model has a higher packet processing overhead than SR-IOV (hardware) enabled NIC.
Amazon VPC promises much higher pps rates at a sub millisecond latencies and that means fewer instances (cost saving) are needed to meet upstream service demands.
Technology Overview
Amazon Enhanced Networking feature, built on top of SR-IOV (PCI-SIG standard) technology, allows instance to have a direct access to subset of PCI resources on a physical NIC. Unlike Xen virtualized driver, SR-IOV compliant driver running on a cloud instance can DMA (Direct Memory Access) to NIC hardware to achieve higher throughput and lower latency. DMA operation from the device to Virtual Machine memory does not compromise the safety of underlying hardware. Intel IO Virtualization Technology (vt-d) supports DMA and interrupt remapping and that restricts the NIC hardware to subset of physical memory allocated for a particular Virtual Machine. No hypervisor interaction is needed except for interrupt processing.
SR-IOV Driver and NIC |
EC2 classic instance can have a single Xen Virtualized NIC, whereas, VPC instance can support multiple NIC (ENI) per instance to help distribute interrupts and network traffic. ENI on AWS instance is assigned a pci virtual function (VF). Each virtual function (lightweight version of pci physical function PF) gets subset of physical NIC pci resources such as: pci configuration registers, iomem regions, queue pairs (Rx/Tx queues), set of Transmit and Receive Descriptors with DMA capabilities. NIC driver (ixgbevf) running inside the instance is para-virtualized (para-virtualized in this context means that driver is modified to only have limited pci capabilities). It can transfer packets directly to hardware, but to change MAC address, device reset, or perform instructions that have global impact, it relies on Physical Function (PF) driver running in privileged domain (Dom0, managed by cloud provider). Communication between VF and PF drivers happens via special hardware registers/buffers, called Mailbox.
Each VF has it own pci resources on NIC |
Intel PCIe NIC is a multi-queue device. AWS assigns each ENI (or VF) two queue pair ( up to a maximum of 16 queue pairs per instance) to distribute network traffic. Each queue pair is pinned to a separate CPU for interrupt and packet processing. NIC hashes on tuple (srcIP, dstIP, srcPort, dstPort) to decide which Rx queue (two Rx queues per ENI) to use for incoming flow. Packets from a single flow uses the same Rx queue to avoid packet reordering. Each queue pair has its own sets of Tx and Rx descriptors (max: 4096). Each Rx/Tx descriptors in queue is used to DMA individual packet from/to the NIC. When all Rx/Tx descriptors are exhausted or in use, NIC driver flows control the network stack. Thus larger number of Rx descriptors can improve pps rates and throughput. Intel PCIe NIC has an embedded Layer-2 switch that sorts packets based upon the destination MAC address or vlan tag. When match is found, it is forwarded to the appropriate queue pair. Layer-2 switch also performs bridging function between VF (ENI) in hardware without hypervisor intervention. Thus multiple instances hosted on the same physical machine can communicate at a much lower network latencies due to bridging feature of NIC, as compared to across physical machines. AWS Placement Groups use this feature to offer lowest possible network latency between instances.
Benchmark Results
Ubuntu AMI used for testing has routing tables set to route traffic coming in an interface to go back out the same interface and vice versa. That allows network traffic to be distributed across multiple ENI. Kernel tuning is baked into the AMI to attain optimum performance for varying type of Netflix workloads. Although each ENI attached to an instance has a dedicated DMA path to a physical NIC, the master driver (running in trusted domain Dom0 and controlled by cloud provider) has ability to set throttling limits on throughput and pps rates per instance. When multiple ENI are configured and stressed, instance maximum pps limit is split across multiple ENI. Tests ran on Amazon 8xlarge instances show:
Number of ENI Configured
|
Max pps rate per ENI
|
Bi-directional pps rates per ENI
|
1
|
2.4 Mpps
|
1.2 Mpps
|
2
|
1.2 Mpps
|
600 Mpps
|
4
|
600 Kpps
|
300 Kpps
|
8
|
300 Kpps
|
150 Kpps
|
Note: Amazon does not comment on maximum PPS rates per instance. We found in our testing that ~2.4 Mpps rates can be achieved on 8xlarge instances. Smaller instances (4xlarge) are throttled at ~ 1Mpps
Micro Benchmark Results
Microbenchmarking tools, pktgen and iperf, are used to test NIC hardware and driver capability to process small packets. Server NIC is flooded to measure maximum PPS rates. Iperf test was run with 68 Bytes MTU to generate small packets. Test results show Amazon instance types: x8large are can process packets at 2 Mpps PPS rates in receive (Rx) or transmit (Tx) and over 1 Mpps for bidirectional traffic.
Micro Benchmark Results
Microbenchmarking tools, pktgen and iperf, are used to test NIC hardware and driver capability to process small packets. Server NIC is flooded to measure maximum PPS rates. Iperf test was run with 68 Bytes MTU to generate small packets. Test results show Amazon instance types: x8large are can process packets at 2 Mpps PPS rates in receive (Rx) or transmit (Tx) and over 1 Mpps for bidirectional traffic.
Micro Benchmark
|
Network PPS Rates
|
Protocol
|
iperf
|
2 Mpps
|
TCP
|
pktgen
|
1.6 Mpps
|
UDP
|
iperf TCP with 68 bytes MTU |
pktgen UDP test |
Application Benchmark Results
Webserver Test:
Nginx web server supports socket option SO_REUSEPORT for better concurrency as it reduces contention among multiple server process/threads accepting connections. Benchmark ran on VPC 8xlarge instance reported maximum RPS rates of over 1 Million on a single instance with 90th percentile latency of 2-5 ms. That is 10x more RPS than EC2 classic instance. EC2 class instance is limited to only 85 kpps. At 1 Million http request/response rate on VPC instance, underlying network reached its maximum limits and thus unable to push more web traffic. Eight clients were used to generate http traffic concurrently using wrk utility against a single nginx web server.
Instance Type
|
RPS Rates (Clients)
|
Web Server Latency
|
Web Server PPS Rates
|
r3.8xl
VPC Instance
|
1.1M
|
1- 4 ms
|
1.2 Mpps (receive)
1.2 Mpss (transmit)
Total: 2.4 Mpps
|
R3.8xl
Classic Instance
|
85K
|
1 ms
Higher load causes server to become unresponsive over the network. Thus kept the Network load low
|
85 kpps (receive)
85 kpps (transmit)
Total: 170 Kpps
|
web server Test in VPC |
web server Test in Classic |
Note: Each dot in the graph represents a single iteration of the test.
Memcached Test:
mcblaster, open source memcached client, is used to generate load on memcached server. memcache benchmark reported 300K RPS (gets/sec) rates at low 1-10 ms latencies on VPC instance as compared to 85-90K RPS rates on EC2 Classic. EC2 classic network maxes out at 90-100k pps rates and become unresponsive over the network. In comparison, VPC instance with SR-IOV can be pushed to much higher pps rates, without inducing higher latencies.
Instance Type
|
RPS Rates (Clients)
|
memcache max Latency
|
% requests completed in < 10 ms
|
VPC Instance
|
300K
|
30 ms
|
99%
|
Classic Instance
|
100K
|
95 ms
|
78%
|
memcache Test in VPC |
memcache Latency distribution in VPC |
Memcached scalability is limited due to higher contention in memcache code as reported by Linux perf.
We were still able to push more load on VPC instance even when memcached was exhibiting higher latencies. NIC driver on memcached server instance continue to process incoming packets at 1.8 Mpps but transmitted at a lower rates of 600 kpps due to overloaded memcached.
Linux Network Stack
Linux network stack can scale to high pps rates with proper kernel tuning and having the following features enabled:
- RPS/RFS network stack feature helps distribute network stack processing across multiple cpus and that reduces latencies, especially on numa servers. During our test we enabled RFS only.
- When NIC driver supports multi-send or bulk packet transmission feature, network stack can queue multiple packets (skb) to NIC driver when passing it for deliver.
- Modern NIC supports multiple Rx/Tx hardware queues where each queue is assigned a dedicated cpu for interrupt processing. Receive traffic is distributed across multiple Rx queues and that utilizes full NIC potential.
- NIC drivers can process multiple packets per interrupt using combination of software and hardware features: NAPI and hardware interrupt mitigation feature, to reduce interrupt processing overhead.
- Benefit of configuring multiple ENI per instance is that it distributes network interrupt and packet processing across larger set of cpus. Multiple ENI can also be used to segregate network traffic for a service to improve visibility.
net tput (Gbits)
|
Frame size (bytes)
|
overhead (bytes)
|
pps rates
|
Latency per packet (ns)
|
10
|
64
|
20
|
16 Mpps
|
63 ns
|
10
|
1500
|
20
|
880 Kpps
|
1136
|
10
|
9000
|
20
|
150 Kpps
|
6750
|
NOTE: pps rate = tput / frame size | Latency per packet = 1 sec / pps rate. Ethernet Frame: MAC Header + smallest payload + CRC = 14 + 46 + 4 = 64 bytes. Additional Overhead: Inter-frame-gap (IFG or IPG) + MAC preamble = 12 + 8 = 20
Server virtualization has evolved from software only to hardware assisted solution. Large chunk of computation work is now offloaded to hardware, bypassing the hypervisor. IO virtualization solution like SR-IOV available on public cloud instances can help accelerate both storage and network performance of latency sensitive workloads. Application with high concurrency capabilities running on a well tuned kernel can now able to service millions of requests on a single public cloud instance.
Intel SR-IOV Driver Companion GuideReferences
Intel Virtualized Technology For Directed IO
Abyss open source software is used for automating: benchmarks execution, metrics collection and graphs generation.
Linux Kernel Tunables applied to AMI
microbenchmark benchmark setup
ngnix webserver benchmark setup
memcached benchmark setup
ngnix webserver benchmark setup
memcached benchmark setup
Amer Ather | Netflix Performance Engineering
Thanks for providing this informative information you may also refer.
ReplyDeletehttp://www.s4techno.com/blog/2016/08/10/interview-questions-of-aws/
Thanks for providing this informative information…..
ReplyDeleteYou may also refer- http://www.s4techno.com/blog/category/aws/
Amazing Article, thank you!. I just wish to give you a big thumbs up for the excellent post. Kindly keep updating your blog. Java Developer is a dream career for IT students.To start wonderful Career to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training from India .
ReplyDeleteor Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.
This comment has been removed by the author.
ReplyDeleteGreat article! Towards the end, you mentioned that "Amazon does not comment on maximum PPS rates per instance." True enough. I did a test to find the actual limit, and there's not one, but two! It appears they work on a best effort / guaranteed throughput mechanism.
ReplyDeleteIf anyone is interested, I put a bunch of graphs and data into a blog post about Max PPS in Amazon EC2.
Thanks! It solves my problem. Great post!
ReplyDeleteserverclear.com
Useful sharing.
ReplyDeleteemergency tree services west palm beach
Thanks for providing this informative information.
ReplyDeletemelbourne remodeling contractors
Nice post.
ReplyDeleteac installation palm beach gardens
Nice post.
ReplyDeletebathroom remodelers south florida
Useful post.
ReplyDeleteempire pest control wellington fl
Thanks for sharing.
ReplyDeletebathroom remodeling south florida
Useful sharing.
ReplyDeletetree trimmers daytona beach
Nice post shared. kitchen remodel contractor miami fl
ReplyDeleteThanks for post this helpful post.
ReplyDeleteemergency tree services hillsborough county
thanks for providing informative or helpful information.
ReplyDeletehotels in Islamabad
thanks for providing informative information.
ReplyDelete123 movies
הייתי חייבת לפרגן, תודה על השיתוף.
ReplyDeleteרהיטים מעוצבים
great article.
ReplyDeleteהתקנת פרגולה
thanks for providing informative or helpful information.
ReplyDelete123 movie
Nice post shared.
ReplyDelete123 movie
תמשיכו בפרסום פוסטים מעניינים כמו זה. תודה
ReplyDeleteמגשי אירוח לאירועים קטנים
בדיוק מה שחיפשתי. תודה רבה.
ReplyDeleteפינות אוכל מעוצבות
פוסט מעניין, משתף עם העוקבים שלי. תודה.
ReplyDeleteמילוי שפתיים
מעולה. תודה על הכתיבה היצירתית.
ReplyDeleteהפקת חתונה
go123movies
ReplyDeleteHiya, I am really glad I have found this info. Today bloggers publish only about gossip and net stuff and this is actually irritating. A good blog with interesting content, this is what I need. Thanks for making this website, and I will be visiting again. Do you do newsletters by email?
בדיוק מה שחיפשתי. תודה רבה.
ReplyDeleteהשקעות בנדלן מניב
מזל שנתקלתי בכתבה הזאת. בדיוק בזמן
ReplyDeleteמשטח פעילות לתינוק
רציתי רק לשאול, אפשר לשתף את הפוסט בבלוג שלי?
ReplyDeleteתמונה על בלוק עץ
אין ספק שהפוסט הזה דורש שיתוף. תודה.
ReplyDeleteמצלמות אבטחה לבית
Nice post shared.
ReplyDeleteSelfie Booth South Coast
Great post
ReplyDeleteglobal asset management seoul
תודה על השיתוף. מחכה לכתבות חדשות.
Deleteעסקים למכירה
אין ספק שזה אחד הנושאים המעניינים. תודה על השיתוף.
ReplyDeleteחברת שיווק באינטרנט
כל מילה. תודה על השיתוף, מחכה לעוד פוסטים בנושא.
ReplyDeleteעיצוב חווית משתמש
Thanks for this nice article.
ReplyDeleteglobal asset management seoul
Thanks for providing this informative information
ReplyDeleteglobal asset management
Spot on with this write-up, I truly believe that this amazing technology site needs much more attention. I’ll probably be returning to read through more, thanks for the information!
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteהדעות שלי קצת חלוקות בעניין הזה אבל ללא ספק כתבת מעניין מאוד.
ReplyDeleteתמונות על קנבס
Thanks for providing this informative information
ReplyDeleteאינטרקום
good.
ReplyDeleteglobal asset management korea
Thank you for this wonderful sharing with us. Keep Sharing.
ReplyDeleteGarage door repair Mississauga
great post.
ReplyDeleteGlobal asset management Seoul
Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting. And I found this one pretty fascinating and it should go into my collection. Very good work!
ReplyDeleteData Science Training
Nice and use full contents.
ReplyDeletestratford management Japan
I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
ReplyDeleteBastion Balance Seoul
Thanks for sharing.
ReplyDeleteEd clinic Las Vegas
Some time we never feel what we have done but for other that is big achievement
ReplyDeleteinvestorsdiurnal.com
I'd love to thank you for the efforts you've made in composing this post. I hope the same best work out of you later on too. I wished to thank you with this particular sites! Thank you for sharing. Fantastic sites!
ReplyDelete360DigiTMG Data Science Course in Bangalore
Great Article. Thanks for sharing info.
ReplyDeletechest of drawers
Excellent post. Thank you for sharing.
ReplyDeleteGarage Door Repair Kanata
חשבתי שאתקל בסתם עוד מאמר שטחי. כמובן שטעיתי.
ReplyDeleteבריכת שחיה ביתית
A superbly written article.
ReplyDeletegarage door repair Calgary
This comment has been removed by the author.
ReplyDeletewhat a great style, it not easy job well don.
ReplyDeleteGarage Door Repair Airdrie
Superb info
ReplyDeleteGarage Door Repair Bethel Park
שירות מצוין. ממליץ בחום.
ReplyDeleteפיאט דוקטו
thanks for sharing the nice article.
ReplyDeletegarage door repair brock
wow that is so interesting and it's a great art. thanks
ReplyDeletegarage door opener repair pittsburgh
Thanks for the information and links you shared this is so useful and quite informative!
ReplyDeletea1 appliance repair
I really enjoyed reading your blog. Great blog
ReplyDeleteเว็บแทงบอล UFABET
yes definitely this type of blogs are really help for people great job.
ReplyDeleteGarage Door Repair Doctors
Thanks for providing this informative information.
ReplyDeleteอเมริกาเหนือจุดเด่น
yes it would be, once my friend gave me lecture about modesty it was amazing and heart touching.
ReplyDeleteLos Angeles Garage Door Repair
It’s really great post, nice blog..I would like to appreciate your work and would like to tell to my friends.
ReplyDeleteGarage Door Springs Replacement
חייב להחמיא על הכתיבה. מאמר מצוין.
ReplyDeleteאינטרקום סקיוריטי
Your experience is great and learning for other peoples.
ReplyDeletegarage door repair east edmonton
Mua vé máy bay tại Aivivu, tham khảo
ReplyDeletevé máy bay đi Mỹ giá rẻ
vé máy bay từ seattle về việt nam
giá vé máy bay đi Los Angeles
ve may bay tu canada ve viet nam
aşk kitapları
ReplyDeleteyoutube abone satın al
cami avizesi
cami avizeleri
avize cami
no deposit bonus forex 2021
takipçi satın al
takipçi satın al
takipçi satın al
takipcialdim.com/tiktok-takipci-satin-al/
instagram beğeni satın al
instagram beğeni satın al
btcturk
tiktok izlenme satın al
sms onay
youtube izlenme satın al
no deposit bonus forex 2021
tiktok jeton hilesi
tiktok beğeni satın al
binance
takipçi satın al
uc satın al
sms onay
sms onay
tiktok takipçi satın al
tiktok beğeni satın al
twitter takipçi satın al
trend topic satın al
youtube abone satın al
instagram beğeni satın al
tiktok beğeni satın al
twitter takipçi satın al
trend topic satın al
youtube abone satın al
takipcialdim.com/instagram-begeni-satin-al/
perde modelleri
instagram takipçi satın al
instagram takipçi satın al
takipçi satın al
instagram takipçi satın al
betboo
marsbahis
sultanbet
I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
ReplyDeleteDevOps Training in Hyderabad
DevOps Course in Hyderabad
Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
ReplyDeleteAWS Training in Hyderabad
AWS Course in Hyderabad
Excellent blog and informative.
ReplyDeleteAI Patasala Python Course in Hyderabad
Rules of Poker | A Guide to the Game of Baccarat
ReplyDeletePoker is a game of skill in which the object is to have a good septcasino hand with 바카라 사이트 the dealer (whether it be a winner) and deccasino the person (or player)
Nice Blog, We are offering Company Video Presentation Service Allow us to give you a FREE CONSULTATION.
ReplyDeleteThank you for sharing https://www.weddingdjinphiladelphia.com/
ReplyDeleteเว็บสล็อตแตกง่าย เว็บสล็อตแตกง่าย สล็อตเว็บตรง อันดับ 1 เว็บสล็อตที่ดีที่สุด
ReplyDeleteเว็บตรงไม่ผ่านเอเย่นต์ เว็บไหนดี ต้องบอกเป็นเสียงเดียวว่า Asia99th ฉีกทุกขอบเขตการพนันออนไลน์ ที่ส่งตรงจาก asia999 และ ib888 เว็บตรง เว็บแท้เว็บใหญ่ที่สุด
ReplyDelete"เว็บสล็อต เว็บสล็อต สล็อตออนไลน์ครบวงจร เว็บสล็อตเว็บตรง คาสิโน สล็อตวอเลท มาแรงที่สุดในตอนนี้
ReplyDeleteถ้าพูดถึงเว็บไซต์ เว็บสล็อต lavacomplex168 สล็อตเว็บตรง"