SlideShare a Scribd company logo
RPS/RFS

twitter	
  :	
  @gokzy
RPS/RFS
•                       NIC
                                	
  

•  google                              	
  

•  kernel	
  2.6.35



                                              2	
  
No	
  RPS/RFS




                3	
  
RPS	
  Only




              4	
  
RPS/RFS




          5	
  
•  iperf          	
  
     –  4    /4          	
  


•                               	
  
     –  UDP 64byte                     	
  	
  




                                                  6	
  
 -­‐	
  Server
•  CPU	
  :	
  4Core	
  -­‐	
  Intel	
  Xeon	
  E5310	
  @	
  1.60GHz	
  (x2)	
  
•  MEM	
  :DDR3	
  Memory	
  2GB	
  
•  NIC	
  :	
  Broadcom	
  NetXtreme	
  BCM5751	
  (on	
  board)	
  
•  OS	
  	
  :	
  Ubuntu	
  Server	
  10.10	
  
•  Kernel	
  :	
  2.6.36.1	
  




                                                                                    7	
  
&
•  CPU	
  mask	
  :	
  ff	
  
    –  /sys/class/net/eth[0-­‐9]/queue 	
  /rx-­‐[0-­‐9]/rps_cpus	
  
    –                            CPU                      	
  
•  RPS	
  Flow	
  Conter	
  :	
  256	
  
    –  /sys/class/net/eth[0-­‐9]/queue/rx-­‐[0-­‐9]/rps_flow_cnt	
  
•  Sock	
  Flow	
  Entries	
  :	
  256	
  
    –  /proc/sys/net/core/rps_sock_flow_entries




                                                                        8	
  
 -­‐	
  	
  PPS

                          300000	
  	
  

                          250000	
  	
  
Packet	
  Per	
  Second




                          200000	
  	
  

                          150000	
  	
  

                          100000	
  	
  

                            50000	
  	
  

                                    0	
  	
  
                                                NO	
  RPS/RFS	
         RPS	
  ONLY	
     RFS	
  
                                                                                                    9	
  
•                    	
  
     –                                     CPU          	
  
          •                   net_rx_action()	
  


     –                                     CPU                   	
  
          •       recvmsg()                                    CPU
                                   ?	
  
          •  iperf CPU4-­‐7                      	
  



                                                                     10	
  
CPU                                               	
  

4000000	
  


                                                                                                                                  NO_RPS	
  
3500000	
                                       3370072	
  
                                                                                                                                  RPS	
  ONLY	
  
                                                               3371706	
  
3000000	
  
                                                                                                                                  RFS	
  
2500000	
  




2000000	
  

                                                                                                    1679144	
   1494721	
   1486299	
  
1500000	
                                                                                     1336311	
  
                                    1177968	
  
                                                                                                          1500483	
   1355766	
  
1000000	
  




 500000	
  


                0	
   0	
  10	
      0	
     1	
   13664	
            0	
   4	
   2	
     0	
   0	
            0	
        0	
               0	
   2	
  
        0	
  


                CPU0	
               CPU1	
          CPU2	
           CPU3	
              CPU4	
               CPU5	
     CPU6	
            CPU7	
  
                                                                                                                                               11	
  
HW
4000000	
  

                           HW                    CPU                                 NO_RPS	
  
3500000	
  

                                                                                     RPS	
  ONLY	
  
3000000	
  
                                                                                     RFS	
  
2500000	
  




2000000	
  




1500000	
  




1000000	
  




 500000	
  




        0	
  


                CPU0	
     CPU1	
     CPU2	
     CPU3	
     CPU4	
     CPU5	
     CPU6	
       CPU7	
  
                                                                                                  12	
  
4000000	
  


                                                                                     NO_RPS	
  
3500000	
  

                                                                                     RPS	
  ONLY	
  
3000000	
  
                                                                                     RFS	
  
2500000	
  
                                                                                         CPU
2000000	
  




1500000	
  




1000000	
  




 500000	
  




        0	
  


                CPU0	
     CPU1	
     CPU2	
     CPU3	
     CPU4	
     CPU5	
     CPU6	
       CPU7	
  
                                                                                                  13	
  
•  RPS/RFS                   UP	
  
    –              PPS    35%	
  UP	
  
    	
  
•  RPS              CPU                          	
  
   –               CPU                    	
  
   	
  
•  RFS recvmsg
             CPU

                                                        14	
  
 
       	
  


              15	
  
•  RPS/RFS                        	
  
     –                                   	
  


•                       CPU                         	
  
     –    get_rps_cpu      	
  


•                   2.6.37-­‐rc5	
  


                                                16	
  
RPS/RFS                                       	
  
               ~                                                      ~
       struct net_device
               :
 struct net_dev_rx_queue *_rx                  struct netdev_rx_queue
               :                              struct rps_map *rps_map

RPS                                    struct rps_dev_flow_table *rps_flow_table

        struct rps_map

       unsigned int len
                                              struct rps_dev_flow_table        RFS
                                               unsigned int mask
      struct rcu_head rcu
                                               struct rcu_head rcu
         u16 cpus[0]
                                               struct work_struct free_work

                                               struct rps_dev_flow flows[0]

               struct rps_dev_flow
             u16 cpu

             u16 fill

             unsigned int last_qtail
                                                                                    17	
  
RPS/RFS                            	
  
           ~                             ~
–                                             	
  
     • 




             struct rps_sock_flow_table

              unsigned int mask

              u16 ents[0]




                                                     18	
  
SW                CPU
•  get_rps_cpu        [net/core/dev.c]                         	
  
•                               CPU                     	
  
•                                 	
  
  –              IP                             	
  
  –  jhash_3words            	
  
  –  sk_buff rxhash                               	
  


•  RPS   RFS CPU                         	
  

                                                                      19	
  
RPS

•  rps_map-­‐>cpus[]                        CPU	
  ID                                     	
  
     –  mask                           CPU              	
  
•  map-­‐>cpus[	
  (	
  (u64)	
  	
  skb-­‐>rxhash	
  *	
  map-­‐>len	
  )	
  	
  >>	
  32]	
  
     –  rxhash	
  :	
                                            	
  
     –  map-­‐>len	
  :	
  mask                                 CPU               	
  
•  8Core 	
  mask	
  0x69(0b01101001)                                           	
  
                                                 rps_map->len

        rps_map->cpus                     1          2           4          7                     20	
  
RFS
•            	
  
•                   2   …	
  

• 
     	
  




                                21	
  
2

•  rps_sock_flow_table	
  
   –  recvmsg() sendmsg()
      CPU                                      	
  
   –  “desired	
  CPU”                  	
  
•  rps_dev_flow_table	
  
   – 
                  CPU           ?	
  
   – 
                         	
  
   –  “current	
  CPU”
                                                      22	
  
 -­‐	
  1

•  desired	
  CPU	
  ,	
  current	
  CPU          unset
               	
  
   –  RPS                          (map-­‐>cpus                       )	
  

•  desired	
  CPU unset	
  or	
  offline                         	
  
   –  current	
  CPU                	
  

•  current	
  CPU	
  ==	
  desired	
  CPU               	
  
   –                        	
  

                                                                              23	
  
 -­‐	
  2
•  current	
  CPU	
  !=	
  desired	
  CPU	
  
     –                                   	
  
     –  backlog	
  queue	
  counter                             	
  
     –  rps_sock_flow_table                                      CPU
          backlog	
  queue                              	
  


•                                               	
  
     –                       process_backlog                          	
  

                                                                             24	
  
netif_receive_skb

                                         CPU               	
  
                    enqueue_to_backlog



                          skb_queue_len(&sd->input_pkt_queue)
                               == 0
backlog	
  queue
                   __napi_schedule          skb_queue_tail()


                                                                  enqueue




                                                                            25	
  
sock_flow_table                                    	
  



          Ethernet 	
  
         get_rps_cpu()	
  

             IP 	
  -­‐	
  IP

          (        )	
  –	
  UDP	
  /	
  TCP	
  
   __udp_queue_rcv_skb()	
  


          (                )	
  –	
  UDP	
  /	
  TCP	
  
        inet_recvmsg()	
  

                                	
  -­‐	
  HTTP
                                                           26	
  
sock_flow_table                                 	
  


•  inet_recvmsg                                                	
  
                               sock
                          sock_rps_record_flow(sk)

                         rps_sock_record_flow()	
  
                     cpu	
  =	
  raw_smp_processorid()	
  
    sock_flow_table-­‐>ents[sk-­‐>sk_hash	
  &	
  sock_flow_table-­‐>mask]	
  =	
  
                                       cpu	
  

•  sk-­‐>sk_hash?	
  

                                                                                    27	
  
sk-­‐>sk_rxhash        (ry
•  __udp_queue_rec_skb()                        	
  
     –  udp_rcv            (            )	
  


•                              skb-­‐
     >rxhash




                                                       28	
  
sock_flow_table              	
  

•                                               	
  
•                                       sock           	
  
     –  hash sock-­‐>sk_hash     	
  
•     recvmsg      sock_flow_table[hash	
  &	
  
   mask] CPU ID              	
  
•             	
  



                                                              29	
  
•  0xffff                                                             	
  
                        –  NO_RPS_CPU	
  =	
  0xffff

[	
  	
  	
  76.198633]	
  rxhash	
  hash	
  
[	
  	
  	
  76.198640]	
  skb-­‐>rxhash	
  &	
  flow_table-­‐>mask	
  :	
  b6c7b0a3	
  &	
  f	
  =	
  3	
  
[	
  	
  	
  76.198644]	
  tcpu	
  :	
  ffff	
  
[	
  	
  	
  76.198647]	
  skb-­‐>rxhash	
  &	
  sock_flow_table-­‐>mask	
  :	
  b6c7b0a3	
  &	
  f	
  =	
  3	
  
[	
  	
  	
  76.198650]	
  next_cpu	
  :	
  ffff	
  
[	
  	
  	
  76.198655]	
  [if(map)]	
  tcpu	
  :	
  2	
  
[	
  	
  	
  76.198657]	
  [cpu_online]	
  tcpu	
  :	
  2	
  




                                                                                                                   30	
  
2                      sock_flow_table


              •                                                     flow_table

    [	
  	
  	
  76.221073]	
  rxhash	
  hash	
  
    [	
  	
  	
  76.221078]	
  skb-­‐>rxhash	
  &	
  flow_table-­‐>mask	
  :	
  b6c7b0a3	
  &	
  f	
  =	
  3	
  
    [	
  	
  	
  76.221082]	
  tcpu	
  :	
  ffff	
  
    [	
  	
  	
  76.221085]	
  skb-­‐>rxhash	
  &	
  sock_flow_table-­‐>mask	
  :	
  b6c7b0a3	
  &	
  f	
  =	
  3	
  
    [	
  	
  	
  76.221088]	
  next_cpu	
  :	
  2	
  
    [	
  	
  	
  76.221090]	
  [cpu	
  chek	
  a]	
  -­‐1	
  
    [	
  	
  	
  76.221093]	
  [cpu	
  chek	
  b]	
  -­‐1	
  
    [	
  	
  	
  76.221095]	
  [got_hash]	
  cpu	
  :	
  2




                                                                                                                       31	
  
3                     CPU

            •  flow_table                                          CPU

    [	
  	
  	
  76.232303]	
  rxhash	
  hash	
  
    [	
  	
  	
  76.232308]	
  skb-­‐>rxhash	
  &	
  flow_table-­‐>mask	
  :	
  b6c7b0a3	
  &	
  f	
  =	
  3	
  
    [	
  	
  	
  76.232312]	
  tcpu	
  :	
  2	
  
    [	
  	
  	
  76.232314]	
  skb-­‐>rxhash	
  &	
  sock_flow_table-­‐>mask	
  :	
  b6c7b0a3	
  &	
  f	
  =	
  3	
  
    [	
  	
  	
  76.232317]	
  next_cpu	
  :	
  2	
  
    [	
  	
  	
  76.232320]	
  cpu	
  :	
  2




                                                                                                                       32	
  
RPS/RFS

More Related Content

Recently uploaded

Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
Data Hops
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 

Recently uploaded (20)

Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

RPS/RFS

  • 2. RPS/RFS •  NIC   •  google   •  kernel  2.6.35 2  
  • 4. RPS  Only 4  
  • 5. RPS/RFS 5  
  • 6. •  iperf   –  4 /4   •    –  UDP 64byte     6  
  • 7.  -­‐  Server •  CPU  :  4Core  -­‐  Intel  Xeon  E5310  @  1.60GHz  (x2)   •  MEM  :DDR3  Memory  2GB   •  NIC  :  Broadcom  NetXtreme  BCM5751  (on  board)   •  OS    :  Ubuntu  Server  10.10   •  Kernel  :  2.6.36.1   7  
  • 8. & •  CPU  mask  :  ff   –  /sys/class/net/eth[0-­‐9]/queue  /rx-­‐[0-­‐9]/rps_cpus   –  CPU   •  RPS  Flow  Conter  :  256   –  /sys/class/net/eth[0-­‐9]/queue/rx-­‐[0-­‐9]/rps_flow_cnt   •  Sock  Flow  Entries  :  256   –  /proc/sys/net/core/rps_sock_flow_entries 8  
  • 9.  -­‐    PPS 300000     250000     Packet  Per  Second 200000     150000     100000     50000     0     NO  RPS/RFS   RPS  ONLY   RFS   9  
  • 10. •    –  CPU   •  net_rx_action()   –  CPU   •  recvmsg() CPU ?   •  iperf CPU4-­‐7   10  
  • 11. CPU   4000000   NO_RPS   3500000   3370072   RPS  ONLY   3371706   3000000   RFS   2500000   2000000   1679144   1494721   1486299   1500000   1336311   1177968   1500483   1355766   1000000   500000   0   0  10   0   1   13664   0   4   2   0   0   0   0   0   2   0   CPU0   CPU1   CPU2   CPU3   CPU4   CPU5   CPU6   CPU7   11  
  • 12. HW 4000000   HW CPU NO_RPS   3500000   RPS  ONLY   3000000   RFS   2500000   2000000   1500000   1000000   500000   0   CPU0   CPU1   CPU2   CPU3   CPU4   CPU5   CPU6   CPU7   12  
  • 13. 4000000   NO_RPS   3500000   RPS  ONLY   3000000   RFS   2500000   CPU 2000000   1500000   1000000   500000   0   CPU0   CPU1   CPU2   CPU3   CPU4   CPU5   CPU6   CPU7   13  
  • 14. •  RPS/RFS UP   –  PPS 35%  UP     •  RPS CPU   –  CPU     •  RFS recvmsg CPU 14  
  • 15.     15  
  • 16. •  RPS/RFS   –    •  CPU   –  get_rps_cpu   •  2.6.37-­‐rc5   16  
  • 17. RPS/RFS   ~ ~ struct net_device : struct net_dev_rx_queue *_rx struct netdev_rx_queue : struct rps_map *rps_map RPS struct rps_dev_flow_table *rps_flow_table struct rps_map unsigned int len struct rps_dev_flow_table RFS unsigned int mask struct rcu_head rcu struct rcu_head rcu u16 cpus[0] struct work_struct free_work struct rps_dev_flow flows[0] struct rps_dev_flow u16 cpu u16 fill unsigned int last_qtail 17  
  • 18. RPS/RFS   ~ ~ –    •  struct rps_sock_flow_table unsigned int mask u16 ents[0] 18  
  • 19. SW CPU •  get_rps_cpu [net/core/dev.c]   •  CPU   •    –  IP   –  jhash_3words   –  sk_buff rxhash   •  RPS RFS CPU   19  
  • 20. RPS •  rps_map-­‐>cpus[] CPU  ID   –  mask CPU   •  map-­‐>cpus[  (  (u64)    skb-­‐>rxhash  *  map-­‐>len  )    >>  32]   –  rxhash  :     –  map-­‐>len  :  mask CPU   •  8Core  mask  0x69(0b01101001)   rps_map->len rps_map->cpus 1 2 4 7 20  
  • 21. RFS •    •  2 …   •    21  
  • 22. 2 •  rps_sock_flow_table   –  recvmsg() sendmsg() CPU   –  “desired  CPU”   •  rps_dev_flow_table   –  CPU ?   –    –  “current  CPU” 22  
  • 23.  -­‐  1 •  desired  CPU  ,  current  CPU unset   –  RPS (map-­‐>cpus )   •  desired  CPU unset  or  offline   –  current  CPU   •  current  CPU  ==  desired  CPU   –    23  
  • 24.  -­‐  2 •  current  CPU  !=  desired  CPU   –    –  backlog  queue  counter   –  rps_sock_flow_table CPU backlog  queue   •    –  process_backlog   24  
  • 25. netif_receive_skb CPU   enqueue_to_backlog skb_queue_len(&sd->input_pkt_queue) == 0 backlog  queue __napi_schedule skb_queue_tail() enqueue 25  
  • 26. sock_flow_table   Ethernet   get_rps_cpu()   IP  -­‐  IP ( )  –  UDP  /  TCP   __udp_queue_rcv_skb()   ( )  –  UDP  /  TCP   inet_recvmsg()    -­‐  HTTP 26  
  • 27. sock_flow_table   •  inet_recvmsg   sock sock_rps_record_flow(sk) rps_sock_record_flow()   cpu  =  raw_smp_processorid()   sock_flow_table-­‐>ents[sk-­‐>sk_hash  &  sock_flow_table-­‐>mask]  =   cpu   •  sk-­‐>sk_hash?   27  
  • 28. sk-­‐>sk_rxhash (ry •  __udp_queue_rec_skb()   –  udp_rcv ( )   •  skb-­‐ >rxhash 28  
  • 29. sock_flow_table   •    •  sock   –  hash sock-­‐>sk_hash   •  recvmsg sock_flow_table[hash  &   mask] CPU ID   •    29  
  • 30. •  0xffff   –  NO_RPS_CPU  =  0xffff [      76.198633]  rxhash  hash   [      76.198640]  skb-­‐>rxhash  &  flow_table-­‐>mask  :  b6c7b0a3  &  f  =  3   [      76.198644]  tcpu  :  ffff   [      76.198647]  skb-­‐>rxhash  &  sock_flow_table-­‐>mask  :  b6c7b0a3  &  f  =  3   [      76.198650]  next_cpu  :  ffff   [      76.198655]  [if(map)]  tcpu  :  2   [      76.198657]  [cpu_online]  tcpu  :  2   30  
  • 31. 2 sock_flow_table •  flow_table [      76.221073]  rxhash  hash   [      76.221078]  skb-­‐>rxhash  &  flow_table-­‐>mask  :  b6c7b0a3  &  f  =  3   [      76.221082]  tcpu  :  ffff   [      76.221085]  skb-­‐>rxhash  &  sock_flow_table-­‐>mask  :  b6c7b0a3  &  f  =  3   [      76.221088]  next_cpu  :  2   [      76.221090]  [cpu  chek  a]  -­‐1   [      76.221093]  [cpu  chek  b]  -­‐1   [      76.221095]  [got_hash]  cpu  :  2 31  
  • 32. 3 CPU •  flow_table CPU [      76.232303]  rxhash  hash   [      76.232308]  skb-­‐>rxhash  &  flow_table-­‐>mask  :  b6c7b0a3  &  f  =  3   [      76.232312]  tcpu  :  2   [      76.232314]  skb-­‐>rxhash  &  sock_flow_table-­‐>mask  :  b6c7b0a3  &  f  =  3   [      76.232317]  next_cpu  :  2   [      76.232320]  cpu  :  2 32