Skip to content
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

Performance regression by 3.5.0 when batching is enabled #226

Open
BewareMyPower opened this issue Sep 11, 2024 · 0 comments
Open

Performance regression by 3.5.0 when batching is enabled #226

BewareMyPower opened this issue Sep 11, 2024 · 0 comments

Comments

@BewareMyPower
Copy link
Contributor

Output of that with pulsar-client v.2.10.2:

Sent 1000 messages in 2.70 seconds
Sent 2000 messages in 5.40 seconds
Sent 3000 messages in 8.16 seconds
Sent 4000 messages in 10.83 seconds
Sent 5000 messages in 13.55 seconds
Sent 6000 messages in 16.14 seconds
Sent 7000 messages in 19.64 seconds
Sent 8000 messages in 22.45 seconds
Sent 9000 messages in 25.22 seconds
Sent 10000 messages in 28.01 seconds
Sent 11000 messages in 30.82 seconds 

Output with version v.3.5.0:

Sent 1000 messages in 102.92 seconds
Sent 2000 messages in 206.03 seconds
Sent 3000 messages in 308.82 seconds
Sent 4000 messages in 411.65 seconds
Sent 5000 messages in 514.40 seconds 
    def create_producer(self, topic,
        batching_enabled = True, batching_max_messages = 5000,
        max_pending_messages = 5000, batching_max_publish_delay_ms = 100,
        compression_type = CompressionType.LZ4):

        self.producer = self.client.create_producer( topic,
            batching_enabled = batching_enabled, batching_max_messages = batching_max_messages,
            max_pending_messages = max_pending_messages, batching_max_publish_delay_ms = batching_max_publish_delay_ms,
            compression_type = compression_type )

        return self.producer
    try:
        cnt = 0
        start_time = time.time()
        while True:
            message = ( "test123" )
            producer.send( ( message ).encode( 'utf-8' ) )
            cnt += 1
            if cnt % 1000 == 0:
                elapsed_time = time.time() - start_time
                print(f"Sent {cnt} messages in {elapsed_time:.2f} seconds")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant