New max sustainable rate implementation
Motivation
Currently the WorkloadGenerator.findMaximumSustainableRate algorithm introduces publish delay. It has been observed the algorithm settles on a publish rate that neither producers nor consumers can keep up with. For example, on a Kafka workload with 100 topics, 1kb message, the algorithm settled on a publish rate of 2.5m msg/s when the producers could only actually achieve 2m msg/s.
Changes
Implement a new algorithm that checks for both receive backlog and publish backlog and adjusts the publish according and has a progressive rate ramp up when there is no observed backlog.
Can we extract an interface:
interface ThroughputOptimizer {
long nextProducerTargetRate(
long observationTimeStamp,
BenchmarkPhase benchmarkPhase,
long currentProducerRate,
long currentConsumerRate,
long currentBacklogSize,
long currentProducerDelay
);
}
enum BenchmarkPhase {
WARM_UP,
BACKLOG_FILL,
LOAD
}
I think it'd be good to pre-calculate the rates prior to passing them to the optimisers as each implementation will need this.
Implementations are free to maintain whatever state they choose and optimise based on whatever factors they wish.
Can we then select the implementation as part of the driver configuration:
name: RabbitMQ
driverClass: io.openmessaging.benchmark.driver.rabbitmq.RabbitMqBenchmarkDriver
...
optmizerClass: io.openmessaging.benchmark.optimizer.MinBacklogAndDelayOptimizer
I'll rebase it onto #338
I've been trying this out. It behaves well IMO, and was able to attain optimal rates very close to those that I've located by hand. I suggest moving from draft status. I suggest not refactoring on to the abstraction #338 at this point in time — it is not ready.
@nahguam Is it good to go for you?
I believe it is. I’ve been using it.
On Thu, 20 Oct 2022 at 06:26, Matteo Merli @.***> wrote:
@nahguam https://github.com/nahguam Is it good to go for you?
— Reply to this email directly, view it on GitHub https://github.com/openmessaging/benchmark/pull/329#issuecomment-1284955357, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABX4VTL3MWVLHGHGU3MHA3WEDJYXANCNFSM6AAAAAAQ3QBYNM . You are receiving this because you commented.Message ID: @.***>