Skip to content

Commit

Permalink
docs: Add tuning tips (#869)
Browse files Browse the repository at this point in the history

---------

Co-authored-by: Renato Cavalcanti <[email protected]>
  • Loading branch information
JustinPihony and octonato authored Oct 17, 2024
1 parent f5aa324 commit 047ee98
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/src/main/paradox/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 047ee98

Please sign in to comment.