benchmark icon indicating copy to clipboard operation
benchmark copied to clipboard

New max sustainable rate implementation

Open nahguam opened this issue 3 years ago • 2 comments

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.

nahguam avatar Oct 03 '22 11:10 nahguam

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

teabot avatar Oct 06 '22 08:10 teabot

I'll rebase it onto #338

nahguam avatar Oct 07 '22 08:10 nahguam

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.

teabot avatar Oct 17 '22 12:10 teabot

@nahguam Is it good to go for you?

merlimat avatar Oct 20 '22 05:10 merlimat

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: @.***>

teabot avatar Oct 20 '22 06:10 teabot