-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add param which like consumeThreadMin of java sdk to control consumption rate #883
Conversation
e938867
to
ab5e3cf
Compare
This |
Just for consistency with java. |
The current implementation is inconsistent with Java. Java is a thread pool, and threads are reused, but in the implementation of Go, goroutines are not reused. |
The purpose of this is not to reuse threads, but to limit concurrency. The original design did not consider concurrency issues at all, which would bring down the downstream system. |
It can be controlled from the speed of pulling ( |
By default, there is a pull speed limit, but the pull contorl needs to be suppressed through consumption. I don’t think that the change of contorlling the pull speed will be smaller. You must know that for RocketMQ Push consumer, pull and consumption are Asynchronous. |
@twz915 In addition, controlling the pull speed does not limit the concurrency of consumption. pullInterval is only for a single queue. If I have a lot of queues, there will still be a large number of messages flooding in at once. IMO, if you think 1024 is too small, you can submit pr to change it. :-D |
I know that for RocketMQ Push consumer, pull and consumption are Asynchronous. but I also think controlling the speed of pulling and controlling the speed of consumption is a more effective way. rocketmq-client-go/consumer/push_consumer.go Lines 606 to 612 in 25003f6
|
@cserwen In most cases, I only need to control the TPS of consumption, so I just pull messages at this speed. |
In general, users should not modify the behavior of pulling messages, but dynamically adjust the pull rate according to the expected consumption rate. This is more intuitive, isn't it? |
I disagree with what you said that the behavior of pulling messages should not be changed. It is acceptable to control by fetching messages or when consuming messages. |
You can set it by |
ConsumeGoroutineNums should allow large values to be set, detail see apache#883 (comment)
ConsumeGoroutineNums should allow large values to be set, detail see #883 (comment)
What is the purpose of the change
ConsumeGoroutineNums
to control the number of goroutines that are consuming.Brief changelog
XX
Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily. Notice,
it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR
.[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.