BewareMyPower commented on PR #25547:
URL: https://github.com/apache/pulsar/pull/25547#issuecomment-4266876037

   I've tested the impact on topic loading latency with this tool: 
https://github.com/BewareMyPower/pulsar-stress
   
   ### Testing
   
   Cluster config: 2 brokers with 2 CPUs for each broker. With only 1 CPU, the 
CPU throttling could affect the results.
   
   ```yaml
   "defaultNumberOfNamespaceBundles":"1"
   "loadBalancerAutoBundleSplitEnabled":"false"
   "loadBalancerSheddingEnabled":"false"
   "metadataStoreBatchingEnabled":"false"
   ```
   
   The default bundle count is 1, so I can use the `admin  namespaces unload 
<ns> -d <broker> 0x00000000_0xffffffff` command to transfer the bundle 
ownership from broker-1 to broker-0.
   
   Namespaces:
   - With `SystemTopicBasedTopicPoliciesService`: 
public/ns1,public/ns2,public/ns3,public/ns4
   - With `MetadataStoreTopicPoliciesService`: 
public/ns5,public/ns6,public/ns7,public/ns8
   
   Each namespace has 5 topics, I ran producers for two namespace sets with the 
same steps:
   1. Use the `unload` commands to transfer all bundles' owner to broker-1
   2. Start the application with 100 messages per second on all topics
   3. Use the `unload` commands to transfer all bundles' owner to broker-0
   4. Observe the `Created Topic` logs from broker-0 for topic loading latencies
   
   ### Analysis
   
   `SystemTopicBasedTopicPoliciesService`:
   
   <img width="1457" height="778" alt="Image" 
src="https://github.com/user-attachments/assets/a614838b-fe52-469a-8efa-4a6341a1b2ae";
 />
   
   `MetadataStoreTopicPoliciesService`:
   
   <img width="1440" height="765" alt="Image" 
src="https://github.com/user-attachments/assets/8983237b-7c35-40e2-9a13-e34f472c352d";
 />
   
   Check
    
[latencies-tracing.patch](https://github.com/user-attachments/files/26818114/latencies-tracing.patch)
 for the specific steps above.
   
   It's not very fair because the metadata store latency contributes the most, 
with system topics based policies service, if the `__change_event` topic has 
not been loaded, all topics in the same namespace need to wait for the managed 
ledger of `__change_event` topic to be loaded.
   
   Full artifacts: 
   
   
[2026-04-14.tar.gz](https://github.com/user-attachments/files/26708879/2026-04-14.tar.gz)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to