SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
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

Contenu connexe

Dernier

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Dernier (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

En vedette

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 HubspotMarius 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 ChatGPTExpeed 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 EngineeringsPixeldarts
 
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 HealthThinkNow
 
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.pdfmarketingartwork
 
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 2024Neil 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 2024Albert 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 InsightsKurio // 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 2024Search 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 summarySpeakerHub
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit 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 managementMindGenius
 
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
 

En vedette (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