Bird
0
0

Given this Python pika code snippet, what is the expected effect on throughput?

medium📝 Command Output Q4 of 15
RabbitMQ - Performance Tuning
Given this Python pika code snippet, what is the expected effect on throughput?
channel.confirm_delivery()
for i in range(1000):
    channel.basic_publish(exchange='', routing_key='task_queue', body=f'Message {i}')
AThroughput is high because messages are sent without confirmation
BThroughput is low because each message waits for confirmation
CThroughput is high because messages are batched automatically
DThroughput is low because messages are sent in parallel
Step-by-Step Solution
Solution:
  1. Step 1: Understand confirm_delivery effect

    confirm_delivery makes the client wait for server confirmation after each message.
  2. Step 2: Analyze throughput impact

    Waiting for confirmation after each message slows down throughput compared to batch confirms.
  3. Final Answer:

    Throughput is low because each message waits for confirmation -> Option B
  4. Quick Check:

    confirm_delivery effect = Lower throughput per message [OK]
Quick Trick: Single confirms slow throughput; batch confirms speed it up [OK]
Common Mistakes:
MISTAKES
  • Assuming confirm_delivery batches messages automatically
  • Thinking messages send in parallel
  • Ignoring confirmation wait impact

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More RabbitMQ Quizzes