Search before asking
After enabled the preciseTopicPublishRateLimiterEnable configuration in broker.conf, if one topic on the broker exceeds the publish rate limit (for example, 1MB/s), it will cause lock contention, leading to an increase in the 99th percentile write latency for other topics that have not reached the rate limit.

The profile shows that there is lock content inside the method org.apache.pulsar.broker.service.PrecisPublishLimiter#tryAcquire.

pulsar-3.0.1.lock.profile.008.html.zip
Minimal reproduce step
Noticed in a fork of 2.8.1, reproduced in 3.0.1 on Linux CentOS 7.9 3.10.0-1160.99.1.el7.x86_64
pulsar-admin namespaces create public/ratelimited
pulsar-admin namespaces set-publish-rate -b 1048576 public/ratelimited
pulsar-admin namespaces policies public/ratelimited
pulsar-perf produce persistent://public/default/no-rate-limit
pulsar-perf produce -r 1600 -ioThreads 4 -n 100 persistent://public/ratelimited/topic-1
What did you expect to see?
One topic exceeds publish rate limit should not effect other topics write latency.
What did you see instead?
Another topic write latency also increased.
Anything else?
No response
Are you willing to submit a PR?
Search before asking
After enabled the

preciseTopicPublishRateLimiterEnableconfiguration inbroker.conf, if one topic on the broker exceeds the publish rate limit (for example, 1MB/s), it will cause lock contention, leading to an increase in the 99th percentile write latency for other topics that have not reached the rate limit.The profile shows that there is lock content inside the method

org.apache.pulsar.broker.service.PrecisPublishLimiter#tryAcquire.pulsar-3.0.1.lock.profile.008.html.zip
Minimal reproduce step
Noticed in a fork of
2.8.1, reproduced in3.0.1on Linux CentOS 7.93.10.0-1160.99.1.el7.x86_64What did you expect to see?
One topic exceeds publish rate limit should not effect other topics write latency.
What did you see instead?
Another topic write latency also increased.
Anything else?
No response
Are you willing to submit a PR?