Search code examples
concurrencyjmeterdagger-2

Dagger framework having trouble when answering concurrent requests to the same endpoint


We have an application that retrieves image urls from a DB. The application is written in Dagger 2.25.4. When testing with Jmeter we have the following scenarios:

  1. Single user performs 1000 requests ---> all responses are as expected
  2. 5 users perform 1 request ---> sometimes a request fails
  3. 5 users perform 1000 requests -----> 3 % or requests fail

The above experiments lead me to think that the server does not handle concurrency well. Even when there's no high memory usage simultaneous requests fail. Now when testing on the server we can see that the time elapsed between requests is very short, about 5 milliseconds. Is there any documentation on what's the minimum temporal separation between requests that this framework can handle, or how it handles concurrent requests? I was looking at https://dagger.dev/ but couldn't find any.


Solution

  • Dagger is a DI framework, it doesn't really "serve" requests, the actual work is being done by:

    So I would recommend:

    1. Enabling profiler tool telemetry for your deployment, you can use JVisualVM, YourKit or JProfiler

    2. Perform a stress test, i.e. start with 1 user and gradually increase the load till 1000 or whatever is the anticipated number at the same time looking at:

      • throughput (number of requests per second)
      • response time
      • number of errors

      when throughput stops growing and response time goes up or errors start occurring you can check logs, profiler snapshots and so on in order to identify the root cause of the bottleneck.