[rabbitmq-discuss] tcp -> rabbitmq gives emfile + 541

Matthew Sackman matthew at lshift.net
Fri Jul 17 15:52:12 BST 2009


Dear Michael,

Sorry for the delay getting back to you. We're all pretty swamped here.

On Wed, Jul 01, 2009 at 05:14:05PM +0100, Michael Nacos wrote:
> could you offer a rule of thumb for calculating the AMQP message size? I am
> sending lists of 5-10 ASCII characters.

Well on the wire, it's pretty efficient - probably only a dozen bytes or
so for AMQP headers (but then, yeah you've got TCP and IP etc as
normal). In memory Erlang won't be quite as efficient, but we keep the
message payload as a binary blob so that won't be expanded. I'd say a
reasonable guess is 100 bytes plus the size of the payload.

However, if the payload is under 64 bytes then Erlang will permit
multiple copies of it to exist in memory at the same time which could in
this case (because the messages, at least as far as v1.6 and before are
concerned) are stored in several places, so you can get duplication of
data. This has been trimmed back somewhat for the new disk queue stuff
so you may well see in the future that for small message sizes, there is
greater efficiency in use of memory.

> Judging from the disk space consumed
> by the mnesia directory, however, I think it's possible we are exhausting
> the RAM, if all messages are also kept in memory. And yes, just before the
> vm crashes, free shows little memory left (~150Mb), there is a little bit of
> lag between reaching this amount and the crash, it's a little hard to tell
> because rabbitmq runs on the database server and there are other programs
> running as well.

Right. Yeah, exhausting RAM is pretty common problem really, and
something that the new disk queue really does address well. "Stay tuned"
is about the best I can offer at this stage. I'm tempted to say it
shouldn't be too much longer, but then I've thought that before and been
proved wrong...

Matthew




More information about the rabbitmq-discuss mailing list