When I run a load test on API which uses akka sync actor (uses ask pattern with 20 seconds timeout, code snippet below), the API invokes a micro service which interacts with Oracle DB for a get operation.
But during load test(100 request per second) I see lot of timeout exceptions and I don't see any error in the external microservice, nor in Oracle. When fork join executor is used, failures are quite minimal, but with thread pool executor, I see frequent failures.
Code snippet:
Timeout timeout = new Timeout(Duration.create(interaction.getActorTimeOut(), TimeUnit.SECONDS));
Future<Object> future = Patterns.ask(ipsActorSystem.synchronousActor, interactionRequest, timeout);
Object result = Await.result(future, timeout.duration());
akka config (Fork join executor):
"default-dispatcher": {
"attempt-teamwork": "on",
"default-executor": {
"fallback": "fork-join-executor"
},
"executor": "fork-join-executor",
"fork-join-executor": {
"parallelism-factor": 50,
"parallelism-max": 100,
"parallelism-min": 10,
"task-peeking-mode": "FIFO"
},
"mailbox-requirement": "",
"shutdown-timeout": "1s",
"throughput": 100,
"throughput-deadline-time": "0ms",
"type": "Dispatcher"
},
Thread pool executor:
"default-dispatcher": {
"attempt-teamwork": "on",
"default-executor": {
"fallback": "thread-pool-executor"
},
"executor": "thread-pool-executor",
"thread-pool-executor": {
"fixed-pool-size" : 10
},
"mailbox-requirement": "",
"shutdown-timeout": "1s",
"throughput": 10,
"throughput-deadline-time": "0ms",
"type": "Dispatcher"
},