Expected Behavior
Knative service scale up after many request.
Actual Behavior
Knative service not scale up.
Steps to Reproduce the Problem
- Start a knative service, the service just sleep one second each request.
- Use wrk send request to channel
Additional Info
Knative service scale according request concurrency.
Current kafka channel implement:
- Channel receive one event, push to kafka topic
- kafka consume one event
- dispatch message and wait it finish
- 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?
Expected Behavior
Knative service scale up after many request.
Actual Behavior
Knative service not scale up.
Steps to Reproduce the Problem
Additional Info
Knative service scale according request concurrency.
Current kafka channel implement:
eventing/pkg/provisioners/kafka/dispatcher/dispatcher.go
Lines 183 to 200 in e8e6dd2
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?