Skip to main content
InterviewHubPRO
Section Overview
Q27

Question 27 of 50

Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

54%
RabbitMQ & AMQP (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

High-Throughput Performance Tuning: Sockets, Erlang VM Schedulers, and OS Tuning.

senior LevelCode ExampleFormsPerformanceSystem Design

In Simple Words: To scale RabbitMQ to 100,000+ msgs/sec:

  1. Linux File Descriptors: Increase ulimit -n 65535 (each AMQP connection and channel consumes a file descriptor).
  2. TCP Buffer Tuning: Adjust /etc/sysctl.conf:
    properties
    net.ipv4.tcp_rmem = 4096 87380 16777216
    net.ipv4.tcp_wmem = 4096 65536 16777216
    
  3. Erlang Schedulers: By default, Erlang allocates one OS OS thread scheduler per CPU core. Pin schedulers to CPU cores with +scl true to avoid context-switching thrash.