[rabbitmq-discuss] does rabbit eat memory?
Simon MacMullen
simon at rabbitmq.com
Fri Nov 26 16:38:05 GMT 2010
Bear in mind that's set by default anyway (to 0.4).
RabbitMQ can benefit from keeping things in memory, but you don't want
it to eat all your memory. Therefore it will try not to exceed (physical
ram) * (vm_memory_high_watermark). It can go a bit over, but at that
point it'll become much more aggressive about swapping messages out to
disk so it's rare to go a long way over.
And as Matthew points out, GCing makes all this a bit approximate. But
my workstation can sustain ca 20k messages per second for as long as
I've cared to watch it.
Cheers, Simon
On 26/11/10 16:30, Jason J. W. Williams wrote:
> Have you tried setting vm_memory_high_watermark in the rabbitmq.config file?
>
> -J
>
> On Fri, Nov 26, 2010 at 9:15 AM, Robert Fuller<fullergalway at gmail.com> wrote:
>> Hi,
>>
>> Rabbitmq is very nice. Easy to install, and very easy to get running with it.
>>
>> We are experimenting using the java interfaces. We are publishing json
>> messages of various sizes to a queue from several servers. A single
>> thread is consuming these messages, acknowledging each message.
>>
>> Having noticed memory consumption on our server I ran a test of using
>> a clean install, and adding 3600 messages to the queue, then consuming
>> these messages and checking for memory usage using top command. I
>> notice that the memory used by rabbitmq slowly creeps upwards.
>>
>> Is there a step I am missing to free some memory?
>>
>> ps and status output below.
>>
>> Thanks,
>> Rob.
>>
>> Here is the ps line at each stage:
>>
>> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
>> before publishing any messages:
>> 26643 rabbitmq 20 0 278m 34m 2844 S 0 0.2 0:01.43 beam.smp
>> after publishing 3666 messages to the queue:
>> 26643 rabbitmq 20 0 315m 65m 2924 S 0 0.4 0:05.21 beam.smp
>> consuming the messages from the queue.
>> after 1st cycle: (zero messages now in queue)
>> 26643 rabbitmq 20 0 300m 52m 2924 S 0 0.3 0:08.18 beam.smp
>> publish 3666 messages with consumer running...
>> after 2nd cycle: (zero messages now in queue)
>> 26643 rabbitmq 20 0 306m 63m 2924 S 0 0.4 0:14.30 beam.smp
>> publish 3666 messages with consumer running...
>> after 3rd cycle: (zero messages now in queue)
>> 26643 rabbitmq 20 0 316m 72m 2924 S 0 0.5 0:18.72 beam.smp
>> later, with all publisher/consumer connections now closed:
>> 26643 rabbitmq 20 0 316m 72m 2924 S 0 0.5 0:19.87 beam.smp
>>
>>
>> Output of status command follows:
>> Status of node rabbit at test ...
>> [{running_applications,
>> [{rabbit_management,"RabbitMQ Management Console","2.1.1"},
>> {webmachine,"webmachine","1.7.0"},
>> {amqp_client,"RabbitMQ AMQP Client","2.1.1"},
>> {rabbit,"RabbitMQ","2.1.1"},
>> {mnesia,"MNESIA CXC 138 12","4.4.12"},
>> {os_mon,"CPO CXC 138 46","2.2.4"},
>> {sasl,"SASL CXC 138 11","2.1.8"},
>> {rabbit_mochiweb,"RabbitMQ Mochiweb Embedding","2.1.1"},
>> {mochiweb,"MochiMedia Web Server","1.3"},
>> {crypto,"CRYPTO version 1","1.6.3"},
>> {inets,"INETS CXC 138 49","5.2"},
>> {stdlib,"ERTS CXC 138 10","1.16.4"},
>> {kernel,"ERTS CXC 138 10","2.13.4"}]},
>> {nodes,[{disc,[rabbit at test]}]},
>> {running_nodes,[rabbit at test]}]
>> ...done.
>>
>>
>> $ uname -a
>> Linux test 2.6.32-25-server #45-Ubuntu SMP Sat Oct 16 20:06:58 UTC
>> 2010 x86_64 GNU/Linux
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.rabbitmq.com
>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
--
Simon MacMullen
Staff Engineer, RabbitMQ
SpringSource, a division of VMware
More information about the rabbitmq-discuss
mailing list