欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

RabbitMQ调优系列1 调整I/O线程线程池

程序员文章站 2022-06-08 22:05:32
...
 
RabbitMQ调优系列1 调整I/O线程线程池


Erlang runtime uses a pool of threads for performing I/O operations asynchronously. The size of the pool is configured via the RABBITMQ_IO_THREAD_POOL_SIZE environment variable. The variable is a shortcut to setting the +A VM command line flag, e.g. +A 128.
【Erlang 运行时使用一个线程池执行异步I/O操作。该线程池的大小通过RABBITMQ_IO_THREAD_POOL_SIZE 环境变量配置。该变量也可设置为 +A 的VM命令行快捷方式标志,例如+A 128。】
# reduces number of I/O threads from 128 to 32
RABBITMQ_IO_THREAD_POOL_SIZE=32

To set the flag directly, use the `RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS` environment variable:
【使用RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS环境变量可以直接设置该标志】
RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="+A 128"

Default value in recent RabbitMQ releases is 128 (30 previously). Nodes that have 8 or more cores available are recommended to use values higher than 96, that is, 12 or more I/O threads for every core available. Note that higher values do not necessarily mean better throughput or lower CPU burn due to waiting on I/O.
【该变量的默认值从早期版本的30个线程,增加到128个线程。建议具有8个或更多可用内核的节点服务器使用大于96个线程的值,即每个可用内核使用12个或更多I/O线程。请注意,较高的值并不一定意味着由于等待I/O而带来更好的吞吐量或更低的CPU消耗。】