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