From 047ee98a1a2266090f4e097caa2db382ee725709 Mon Sep 17 00:00:00 2001 From: Justin Pihony Date: Thu, 17 Oct 2024 07:55:38 -0400 Subject: [PATCH] docs: Add tuning tips (#869) --------- Co-authored-by: Renato Cavalcanti --- docs/src/main/paradox/configuration.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/src/main/paradox/configuration.md b/docs/src/main/paradox/configuration.md index d26828ef0..80ea507dd 100644 --- a/docs/src/main/paradox/configuration.md +++ b/docs/src/main/paradox/configuration.md @@ -145,3 +145,11 @@ akka-persistence-jdbc { The plugin automatically shuts down the HikariCP connection pool when the ActorSystem is terminated. This is done using @apidoc[ActorSystem.registerOnTermination](ActorSystem). + +## Tuning for Lower Latency + +The `jdbc-read-journal.journal-sequence-retrieval.query-delay` configuration controls how often the actor queries for new data. The default is `1s`, but this can be set lower for latency-sensitive applications to reduce the time between data retrievals. + +Similarly, `jdbc-read-journal.refresh-interval` dictates how often the system polls for new events when idle, also defaulting to `1s`. In mostly idle applications that still require low latencies, it is important to adjust both `query-delay` and `refresh-interval` to achieve optimal performance. Lowering just one of these values might not be sufficient for reducing latency. + +As with any performance tuning, it’s important to test these settings in your environment to find the right balance. Reducing these intervals will increase the load on your database, as each node in the cluster will be querying the event journal more frequently.