Bird
0
0

You want to optimize a RabbitMQ client to handle 1000 messages per second. Which approach best uses connection and channel pooling?

hard📝 Best Practice Q15 of 15
RabbitMQ - Performance Tuning
You want to optimize a RabbitMQ client to handle 1000 messages per second. Which approach best uses connection and channel pooling?
ACreate 1000 connections, each with one channel.
BCreate one connection and open 10 channels reused for sending messages.
CCreate one connection and one channel, sending all messages sequentially.
DCreate 10 connections, each with 100 channels, and never close them.
Step-by-Step Solution
Solution:
  1. Step 1: Understand connection overhead

    Many connections are costly; one connection with multiple channels is efficient.
  2. Step 2: Use channel pooling

    Opening 10 channels on one connection and reusing them balances load and resource use.
  3. Step 3: Avoid resource leaks

    Channels should be reused and closed properly when done to keep app healthy.
  4. Final Answer:

    Create one connection and open 10 channels reused for sending messages. -> Option B
  5. Quick Check:

    One connection + multiple reusable channels = best practice [OK]
Quick Trick: Use few connections with multiple reusable channels [OK]
Common Mistakes:
MISTAKES
  • Opening too many connections wastes resources
  • Using only one channel limits throughput
  • Never closing channels causes leaks

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More RabbitMQ Quizzes