且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

启动服务时RabbitMQ虚拟主机报错

更新时间:2023-12-01 20:36:28

我知道发生了什么.我团队中的某个人(我)正在创建与 RabbitMQ 的空前数量的连接.对于每个连接,都会为一个或多个文件创建一个文件处理程序,不确定是哪个.操作系统(在我的例子中是 Windows)有一个文件处理程序限制,不确定这个限制是什么,但是当达到时,会抛出一个错误.这损坏了虚拟主机 (/),我不得不删除它并重新创建它.好在这不是生产,因为那样所有的消息都会消失.

I figured out what was going on. Someone on my team (me) was creating an unprecedented amount of connections to RabbitMQ. For each connection a file handler is created to one or more files, not sure which. The OS (Windows in my case) has a file handler limit, not sure what the limit is, but when reached, an error is thrown. This corrupted the virtual host (/) and I had to delete it and create it again. Good thing this wasn't production, because then all the messages would've been gone.

修改(2020 年 6 月):

可能会对此进行修复,因此它不会再次发生.虚拟主机可以限制它们允许的连接数.这样 Windows 就不会在许多文件句柄上出错.在管理门户中查看 ->管理员 ->限制,将最大连接数设置为您认为适合您的设置的数字.

There might be a fix for this so it can't happen again. A virtual host can be limited in how many connections they allow. This way Windows won't faulter on the many file handles. Look in the management portal -> Admin -> Limits, set max-connections to a number you think it plausible for your setup.