作者简介:大家好,我是smart哥,前中兴通讯、美团架构师,现某互联网公司CTO
联系qq:184480602,加我进群,大家一起学习,一起进步,一起对抗互联网寒冬
学习必须往深处挖,挖的越深,基础越扎实!
阶段1、深入多线程
阶段2、深入多线程设计模式
阶段3、深入juc源码解析
码哥源码部分
码哥讲源码-原理源码篇【2024年最新大厂关于线程池使用的场景题】
码哥讲源码-原理源码篇【揭秘join方法的唤醒本质上决定于jvm的底层析构函数】
码哥源码-原理源码篇【Doug Lea为什么要将成员变量赋值给局部变量后再操作?】
码哥讲源码【谁再说Spring不支持多线程事务,你给我抽他!】
打脸系列【020-3小时讲解MESI协议和volatile之间的关系,那些将x86下的验证结果当作最终结果的水货们请闭嘴】
1.通过rabbitmqctl命令查看
[root@rabbit1 /]# rabbitmqctl status
...
File Descriptors
Total: 2, limit: 1048469
Sockets: 0, limit: 943620
...
2.通过Management UI查看
Socket descriptors说明:
The network sockets count and limit managed by RabbitMQ.
When the limit is exhausted RabbitMQ will stop accepting new network connections.
File descriptors说明:
File descriptor count and limit, as reported by the operating system. The count includes network sockets and file handles.
To optimize disk access RabbitMQ uses as many free descriptors as are available, so the count may safely approach the limit. However, if most of the file descriptors are used by sockets then persister performance will be negatively impacted.
To change the limit on Unix / Linux, use “ulimit -n”. To change the limit on Windows, set the ERL_MAX_PORTS environment variable
To report used file handles on Windows, handle.exe from sysinternals must be installed in your path. You can download it here.
RabbitMQ的Socket连接数(socket descriptors)是文件描述符(File descriptors)的一个子集,也就是说,RabbitMQ能同时打开的最大连接数和最大文件句柄数都是受限于操作系统关于文件描述符数量的限制,两者是此消彼长的关系。
查看CentOS7文件系统可以打开文件句柄数:
[root@rabbit1 /]# ulimit -n
1048566