Skip to content

add a test to illustrate rate-limit application - #247

Open
krichprollsch wants to merge 1 commit into
mainfrom
rate-limit
Open

krichprollsch wants to merge 1 commit into
mainfrom
rate-limit

Conversation

@krichprollsch

Copy link
Copy Markdown
Member

Test result for lightpanda-io/browser#3266

server      http://127.0.0.2:33221/page
runs        200 navigations x 2 phases, 15000ms pause between them
browser     ../../browser/zig-out/bin/lightpanda



========================================================================================
SUMMARY
========================================================================================

  mode      phase  reqs  span (s)  req/s  gap p50  gap p95  gap max  client p50
  --------  -----  ----  --------  -----  -------  -------  -------  ----------
  off           1   200      0.77  257.4      3.2      5.3     92.9         3.2
                2   200      0.64  309.2      3.1      3.8      5.9         3.1
  fixed100      1   200     19.00   10.5     99.8    100.7    100.8        99.8
                2   200     19.00   10.5     99.9    100.7    100.9        99.9
  adaptive      1   200     16.06   12.4     99.2    100.6    100.7        99.1
                2   200     16.06   12.4     99.2    100.6    100.7        98.7

  gap = time between two consecutive requests as seen by the server (ms)
  client p50 = median page.goto() duration as seen by puppeteer (ms)


----------------------------------------------------------------------------------------
1. SERVER POV -- requests received over time (all modes)
----------------------------------------------------------------------------------------

           requests received
      400 |                       o                                       aaa     fff
          |                      oo                                    aaaa    ffff  
          |                      o                                  aaaa    ffff     
          |                      o                               aaaa    ffff        
      306 |                      o                            aaa     ffff           
          |                      o                         aaa    ffff               
          |                      o                      aaaa   ffff                  
          |                      o                     aa   ffff                     
      212 | o                    a   f                a   fff                        
          | o                 aaaaffff                                               
          | o              aaaaffff                                                  
          | o          aaaaaffff                                                     
      118 | o       aaaaffff                                                         
          |oo    aaaaffff                                                            
          |o   aaaffff                                                               
          |o aaafff                                                                  
     23.5 |aaaf                                                                      
        0 |a                                                                         
          +--------------------------------------------------------------------------
           0.001           13.3               26.5              39.8             53.0
           elapsed (s)

           o disabled (--http-nav-delay 0)   f fixed 100ms (--http-nav-delay 100)   a adaptive (default, no flag)

  The flat part in the middle of each line is the pause. A line that bends
  to the right is slowing down; adaptive bends, then starts steep again
  after the pause because its pressure cooled down.


----------------------------------------------------------------------------------------
2. SERVER POV -- spacing between requests: disabled (--http-nav-delay 0)
----------------------------------------------------------------------------------------

           gap since previous request (ms)
     92.9 |  o                                 :                                     
          |                                    :                                     
          |                                    :                                     
          |                                    :                                     
     64.3 |                                    :                                     
          |                                    :                                     
          |                                    :                                     
          |                                    :                                     
     35.7 |                                    :                                     
          |                                    :                                     
          |                                    :                                     
          |                                    :                                     
     7.14 |o o o oo       o  o   oo  o  oo o   :ooo o  ooo o    o o      o   o       
        0 |ooooooooooooooooooooooooooooo ooooooo oooooooooooooooooooooooooooooooooooo
          +--------------------------------------------------------------------------
           2                102                201               301              400
           request number   (":" = the 15000ms pause)

  end of phase 1: 3ms spacing
  start of phase 2 after 15000ms idle: 4ms spacing


----------------------------------------------------------------------------------------
2. SERVER POV -- spacing between requests: fixed 100ms (--http-nav-delay 100)
----------------------------------------------------------------------------------------

           gap since previous request (ms)
      101 |  fffffffffffffffffffffffffffffffffff  fffffffffffffffffffffffffffffffffff
          |  f                                 :                                     
          |                                    :                                     
          |  f                                 :                                     
     69.9 |                                    : f                                   
          |                                    :                                     
          |                                    :                                     
          |                                    :                                     
     38.8 |                                    :                                     
          |                                    :                                     
          |                                    :                                     
          |                                    :                                     
     7.76 |                                    :f                                    
        0 |ff                                  :ff                                   
          +--------------------------------------------------------------------------
           2                102                201               301              400
           request number   (":" = the 15000ms pause)

  end of phase 1: 100ms spacing
  start of phase 2 after 15000ms idle: 4ms spacing


----------------------------------------------------------------------------------------
2. SERVER POV -- spacing between requests: adaptive (default, no flag)
----------------------------------------------------------------------------------------

           gap since previous request (ms)
      101 |                  aaaaaaaaaaaaaaaaaaa                  aaaaaaaaaaaaaaaaaaa
          |  a                                 :                                     
          |                                    :                                     
          |         aaaaaaaaaa                 :         aaaaaaaaa                   
     69.7 |                                    :                                     
          |     aaaaa                          :    aaaaaa                           
          |                                    :                                     
          |                                    :                                     
     38.7 |   aa                               :  aaa                                
          |  a                                 :                                     
          |                                    :  a                                  
          |                                    :                                     
     7.75 |                                    :a                                    
        0 |aaa                                 :aa                                   
          +--------------------------------------------------------------------------
           2                102                201               301              400
           request number   (":" = the 15000ms pause)

  end of phase 1: 100ms spacing
  start of phase 2 after 15000ms idle: 5ms spacing
  browser logged "navigation delayed" 1 time(s)


----------------------------------------------------------------------------------------
3. CLIENT POV -- page.goto() duration (all modes)
----------------------------------------------------------------------------------------

           goto() duration (ms)
      103 |  ffffffffffffffffaaaaaaaaaaaaaaaaaaa: ffffffffffffffffaaaaaaaaaaaaaaaaaaa
          |   fffffffffffffffaaaaaaaaaaaaaaaaaaa: fffff ffff fffffaaaaaaaaaaaaaaaaaaa
          |  a                                  :                                    
          |  f      aaaaaaaaaa                  :        aaaaaaaaaa                  
     75.7 |         a   a a                     :               a                    
          |                                     :f                                   
          |     aaaaa                           :   aaaaaa                           
          |                                     :    a                               
     48.1 |                                     :                                    
          |   aaa                               : aaa                                
          |                                     :                                    
          |   a                                 : a                                  
     20.6 |                                     :                                    
          |                                     :                                    
          |afaoo ooo      o  o oooo  o  ooo oo  aaooo  ooo o   oo oo  o ooo  o   o   
        0 |aaaoooooooooooooooooooooooooooooooooofaooooooooooooooooooooooooooooooooooo
          +--------------------------------------------------------------------------
           1                101                201               300              400
           navigation number   (":" = the 15000ms pause)

           o disabled (--http-nav-delay 0)   f fixed 100ms (--http-nav-delay 100)   a adaptive (default, no flag)

  The client waits inside page.goto(): the rate limiter holds the request
  before it goes on the wire, so the delay shows up as navigation time.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant