erlang RabbitMQ通用服务器rabbit_disk_monitor正在终止/ eheap_alloc:无法分配229520字节的内存(类型为“old_heap”)

vsikbqxv  于 2022-12-08  发布在  Erlang
关注(0)|答案(3)|浏览(627)

RabbitMQ崩溃了。RabbitMQ正常工作了很多天(10-15天)。我不明白它为什么会崩溃。
我在Erlang 17.0上使用RabbitMQ 3.4.0
Erlang已经为崩溃创建了转储文件。

eheap_alloc: Cannot allocate 229520 bytes of memory (of type "old_heap").

另外注意,rabbitmq发布-订阅消息的负载非常低。(最大值:1-2条消息/秒)。而且,rabbitMQ消息是在它到来时处理的,所以rabbitMQ几乎一直是空的。磁盘空间和内存也是足够的。

More system info:
Limiting to approx 8092 file handles (7280 sockets)
Memory limit set to 6553MB of 16383MB total.
Disk free limit set to 50MB.

RabbitMQ日志如下所示。
第一次

s1ag04yj

s1ag04yj1#

从错误信息中可以看出,由于系统限制,rabbitmq无法打开更多的文件。您可以将最大打开文件数设置为较高的值来避免此问题。
https://serverfault.com/questions/249477/windows-server-2008-r2-max-open-files-limit

4zcjmb1e

4zcjmb1e2#

这里有两个不相关的错误:一个是VM分配内存失败。2另一个是磁盘空间监视器终止。3磁盘空间监视器是可选的,在一些不太常见的平台上或有特定的安全限制,它会失败。4这不会使VM停止,当然也与堆分配失败无关。
堆分配失败通常归结为两种最常见的情况:

  • Erlang 17.x中修复了一个已知错误(不记得是哪个特定补丁版本,因此使用17.5)
  • 在64位操作系统上运行32位Erlang/OTP。

陈宇关于EACCESS系统调用错误的评论是正确的。

dsf9zpds

dsf9zpds3#

I get analog error systemd unit for activation check: "rabbitmq-server.service" eheap_alloc: Cannot allocate 306586976 bytes of memory (of type "heap").^M ^M Crash dump is being written to: erl_crash.dump...done^M

ulimit -a 
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 514979
max locked memory       (kbytes, -l) 65536
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1048576
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 514979
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

this is crush dump =erl_crash_dump:0.5

Wed Dec  2 17:16:31 2020
Slogan: eheap_alloc: Cannot allocate 306586976 bytes of memory (of type "heap").
System version: Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:32:32] [ds:32:32:10] [async-threads:512] [kernel-poll:true]
Compiled: Mon Feb  5 17:34:00 2018
Taints: crypto,asn1rt_nif,erl_tracer,zlib
Atoms: 34136
Calling Thread: scheduler:0
=scheduler:1
Scheduler Sleep Info Flags: SLEEPING | TSE_SLEEPING | WAITING
Scheduler Sleep Info Aux Work:
Current Port:
Run Queue Max Length: 0
Run Queue High Length: 0
Run Queue Normal Length: 0
Run Queue Low Length: 0
Run Queue Port Length: 0
Run Queue Flags: OUT_OF_WORK | HALFTIME_OUT_OF_WORK
Current Process:
=scheduler:2
Scheduler Sleep Info Flags: SLEEPING | TSE_SLEEPING
Scheduler Sleep Info Aux Work: THR_PRGR_LATER_OP
Current Port:
Run Queue Max Length: 0
Run Queue High Length: 0
Run Queue Normal Length: 0
Run Queue Low Length: 0
Run Queue Port Length: 0
Run Queue Flags: OUT_OF_WORK | HALFTIME_OUT_OF_WORK | NONEMPTY | EXEC
Current Process:
=scheduler:3
Scheduler Sleep Info Flags: 
Scheduler Sleep Info Aux Work: DELAYED_AW_WAKEUP | DD | THR_PRGR_LATER_OP
Current Port: 
Run Queue Max Length: 0
Run Queue High Length: 0
Run Queue Normal Length: 0
Run Queue Low Length: 0
Run Queue Port Length: 0
Run Queue Flags: OUT_OF_WORK | HALFTIME_OUT_OF_WORK | NONEMPTY | EXEC
Current Process: <0.12306.0>
Current Process State: Running
Current Process Internal State: ACT_PRIO_NORMAL | USR_PRIO_NORMAL | PRQ_PRIO_NORMAL | ACTIVE | RUNNING | TRAP_EXIT | ON_HEAP_MSGQ
Current Process Program counter: 0x00007f2f3ab3a060 (unknown function)
Current Process CP: 0x0000000000000000 (invalid)
Current Process Limited Stack Trace:
0x00007f2b50252d68:SReturn addr 0x32A6EC98 (rabbit_channel:handle_method/3 + 6712)
0x00007f2b50252d78:SReturn addr 0x32A69630 (rabbit_channel:handle_cast/2 + 4160)
0x00007f2b50252df8:SReturn addr 0x51102708 (gen_server2:handle_msg/2 + 1808)
0x00007f2b50252e28:SReturn addr 0x3FD85E70 (proc_lib:init_p_do_apply/3 + 72)
0x00007f2b50252e48:SReturn addr 0x7FFB4948 (<terminate process normally>)
=scheduler:4
Scheduler Sleep Info Flags: SLEEPING | TSE_SLEEPING | WAITING

相关问题