Skip to content

Knative service can not scale up with kafka cluster channel provisioner #693

@fatkun

Description

@fatkun

Expected Behavior

Knative service scale up after many request.

Actual Behavior

Knative service not scale up.

Steps to Reproduce the Problem

  1. Start a knative service, the service just sleep one second each request.
  2. Use wrk send request to channel

Additional Info

Knative service scale according request concurrency.

Current kafka channel implement:

  1. Channel receive one event, push to kafka topic
  2. kafka consume one event
  3. dispatch message and wait it finish
  4. consume next event

go func() {
for {
msg, more := <-consumer.Messages()
if more {
d.logger.Info("Dispatching a message for subscription", zap.Any("channelRef", channelRef), zap.Any("subscription", sub))
message := fromKafkaMessage(msg)
err := d.dispatchMessage(message, sub)
if err != nil {
d.logger.Warn("Got error trying to dispatch message", zap.Error(err))
}
// TODO: handle errors with pluggable strategy
consumer.MarkOffset(msg, "") // Mark message as processed
} else {
break
}
}
d.logger.Info("Consumer for subscription stopped", zap.Any("channelRef", channelRef), zap.Any("subscription", sub))
}()

There only one concurrency if start one dispatcher pod. It's not enough to scale up knative service.
Can we use multi-goroutine to dispatch message?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions