I’m currently using Akka Persistence w/ the Datastax Cassandra plugin against CosmosDB. I also leverage Akka Persistence Query to create a projection from a Cassandra Read Journal. (see below)
The thing is, running our projections with no new events coming in, I’m seeing ~186 RU/s (approximately, requests/second) against our DB on the akka.tag_views table when the projection is running. I’m running 12 instances of a projection. My tags are “aggregate-slice-{1,12}” naturally. This load seems incredibly high and it feels like the DB is extremely busy. How do I configure it to do, for example 1 read per second? This seems a lot more reasonable…
How do I stop akka persistence query from sending so many requests/s? Am I running too many projections? Is my eventual consistency too low? Am I missing some unknown config? Is it backtracking too much for some reason? My config is provided below, I’ve played with some numbers but nothing seems to help “that” much.
Edit: It appears to be the high-frequency backtracking interval that’s causing a ruckus.
cassandra {
events-by-tag {
bucket-size = "Day"
eventual-consistency-delay = 200ms # i've tinkered with this from 200ms to 5s
flush-interval = 50ms
pubsub-notification = on
first-time-bucket = "20201102T00:00"
gc-grace-seconds = 0
}
query {
refresh-interval = 2s
}
SourceProvider<Offset, EventEnvelope<Message>> sourceProvider = EventSourcedProvider
.eventsByTag(
system,
CassandraReadJournal.Identifier(),
tag
);
return CassandraProjection.atLeastOnce(
ProjectionId.of(PROJECTION_NAME, tag),
sourceProvider,
new CfsProjectionHandler(system, tag, producer)
);
1 post - 1 participant