0
votes

Premises

  1. Rest API in scala / spray
  2. Simple method that always returns OK
  3. I try to achieve an average of 20k requests per second
  4. Both machines (tester & tested) well configured (EC2 dedicated servers, each one with only its API & Gatling, configuration files sudo sysctl -w net.ipv4.ip_local_port_range="1025 65535" echo 300000 | sudo tee /proc/sys/fs/nr_open echo 300000 | sudo tee /proc/sys/fs/file-max, /etc/security/limits.conf, ulimit -a --> 65535)

This is my simple test file scenario, just 1 user:

    setUp(scn.inject(constantUsersPerSec(1) during(60 seconds)))
    .throttle(
              //reachRps(20000) in (60 seconds),
              //holdFor(1 minute)
              //,
              jumpToRps(20000),
              holdFor(1 minutes)
             )
    .protocols(httpConf)

I try to achieve 20k rqs (maximum) in 60sec or jump directly to 20k and maintain there along 1 minute.

This is always my results after executing Gatling script:

Simulation finished
Parsing log file(s)...
Parsing log file(s) done
Generating reports...

================================================================================
---- Global Information --------------------------------------------------------
> request count                                         60 (OK=60     KO=0     )
> min response time                                      0 (OK=0      KO=-     )
> max response time                                      2 (OK=2      KO=-     )
> mean response time                                     1 (OK=1      KO=-     )
> std deviation                                          0 (OK=0      KO=-     )
> response time 50th percentile                          1 (OK=1      KO=-     )
> response time 75th percentile                          2 (OK=2      KO=-     )
> mean requests/sec                                  1.017 (OK=1.017  KO=-     )
---- Response Time Distribution ------------------------------------------------
> t  800 ms  t > 1200 ms                                            0 (  0%)
> failed                                                 0 (  0%)

I don't understand what means exactly these results... or, perhaps, I'm not configuring the right scenario for my goal.

I tried with several scenaries:

    //setUp(scn.inject(atOnceUsers(20000)).protocols(httpConf))         
    //setUp(scn.inject(Users(200000).ramp(10)).protocols(httpConf))
    //setUp(scn.inject(constantUsersPerSec(20000) during(1 seconds)).protocols(httpConf))           
    //setUp(scn.inject(constantUsersPerSec(20000) during(1 seconds))).protocols(httpConf)
   //setUp(scn.inject(rampUsers(1500) over (60 seconds)))
   //setUp(scn.inject(atOnceUsers(50000)))
   //      .throttle(jumpToRps(50000),
   //                holdFor(1 minutes))
   //      .protocols(httpConf)

   setUp(scn.inject(constantUsersPerSec(1000) during(30 seconds)))
    .throttle(
              reachRps(20000) in (30 seconds),
              holdFor(1 minute)
              //,
              //jumpToRps(20000),
              //holdFor(1 minutes)  
             )
    .protocols(httpConf)

So, I don't know how to configure my scala test file for, simply, getting a value like that:

> mean requests/sec                                  20000 (OK=20000  KO=-     )
1

1 Answers

0
votes

You don't get throttle right. From the documentation:

You still have to inject users at the scenario level. Throttling tries to ensure a targeted throughput with the given scenarios and their injection profiles (number of users and duration). It’s a bottleneck, ie an upper limit. If you don’t provide enough users, you won’t reach the throttle. If your injection lasts less than the throttle, your simulation will simply stop when all the users are done. If your injection lasts longer than the throttle, the simulation will stop at the end of the throttle.

How can you expect reaching 20000 rps whith only injection 1 user per second?