You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by "afeiiiii (via GitHub)" <gi...@apache.org> on 2023/05/30 12:03:19 UTC

[GitHub] [rocketmq-client-python] afeiiiii opened a new issue, #135: cpu high load with threading

afeiiiii opened a new issue, #135:
URL: https://github.com/apache/rocketmq-client-python/issues/135

   consumer with threading  cause high cpu load。 how can i solve it ?
   
   ### high load code: 
   `def start_consumer():
       consumer = PushConsumer(group)
       consumer.set_namesrv_addr(address)  
       consumer.subscribe(topic=topic, callback=callback) 
       consumer.start()
   
       while True:
           time.sleep(3600)
   
   thread = Thread(target=start_consumer)
   thread.start()`
   
   ### low load code not with thread:
   ` consumer = PushConsumer(group)
       consumer.set_namesrv_addr(address)  
       consumer.subscribe(topic=topic, callback=callback) 
       consumer.start()
   
       while True:
           time.sleep(3600)`


-- 
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: dev-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org