Hello all,

We are using RabbitMQ 2.4 in our production environment and are running into
issues with memory usage. We are seeing a direct relation between the number
of connections and the memory usage (the graphs are identical). The ratio is
200 KB / connection which seems hefty especially with about 50,000
connections open on each broker this ends up consuming all the ram. What is
surprising is how constant that number is and I'm wondering if there is a
setting somewhere that can be tweaked to change that ratio. Note that we
have very few or no messages in memory (only around 500 MB of memory is used
by messages according to rabbitmqctl).

Thank you!

--
Raphael.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110923/d7f3e710/attachment.htm>

Search Discussions

  • Matthias Radestock at Sep 23, 2011 at 7:18 pm
    Raphael,
    On 23/09/11 19:11, Raphael Simon wrote:
    We are using RabbitMQ 2.4 in our production environment and are running
    into issues with memory usage. We are seeing a direct relation between
    the number of connections and the memory usage (the graphs are
    identical). The ratio is 200 KB / connection which seems hefty
    especially with about 50,000 connections open on each broker this ends
    up consuming all the ram.
    [...]
    I'm wondering if there is a setting somewhere that can be tweaked
    Reduce the socket send and receive buffer sizes by sticking the
    following in your rabbitmq.config:

    [{rabbit, [{tcp_listen_options, [binary,
    {packet, raw},
    {reuseaddr, true},
    {backlog, 128},
    {nodelay, true},
    {sndbuf, 1024},
    {recbuf, 1024},
    {exit_on_close, false}]}]}].

    (All but the sndbuf and recbuf settings are identical to the defaults)


    Regards,

    Matthias.
  • Raphael Simon at Sep 30, 2011 at 12:29 am
    Thank you Matthias. We deployed that config to production but haven't seen
    any real change... How can we tell if RabbitMQ is indeed using these
    settings?

    Thanks!

    --
    Raphael.

    On Fri, Sep 23, 2011 at 12:18 PM, Matthias Radestock
    wrote:
    Raphael,

    On 23/09/11 19:11, Raphael Simon wrote:

    We are using RabbitMQ 2.4 in our production environment and are running
    into issues with memory usage. We are seeing a direct relation between
    the number of connections and the memory usage (the graphs are
    identical). The ratio is 200 KB / connection which seems hefty
    especially with about 50,000 connections open on each broker this ends
    up consuming all the ram.
    [...]

    I'm wondering if there is a setting somewhere that can be tweaked
    Reduce the socket send and receive buffer sizes by sticking the following
    in your rabbitmq.config:

    [{rabbit, [{tcp_listen_options, [binary,
    {packet, raw},
    {reuseaddr, true},
    {backlog, 128},
    {nodelay, true},
    {sndbuf, 1024},
    {recbuf, 1024},
    {exit_on_close, false}]}]}].

    (All but the sndbuf and recbuf settings are identical to the defaults)


    Regards,

    Matthias.
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110929/27ac145a/attachment.htm>
  • Matthias Radestock at Sep 30, 2011 at 6:32 am
    Raphael,
    On 30/09/11 01:29, Raphael Simon wrote:
    Thank you Matthias. We deployed that config to production but haven't
    seen any real change... How can we tell if RabbitMQ is indeed using
    these settings?
    See http://www.rabbitmq.com/configure.html#verify-configuration

    When rabbit starts up it tells you what config file it is using, e.g.

    +---+ +---+
    +---+ +-------+
    RabbitMQ +---+ |
    v%%VSN%% +---+ |
    +-------------------+
    AMQP 0-9-1 / 0-9 / 0-8
    Copyright (C) 2007-2011 VMware, Inc.
    Licensed under the MPL. See http://www.rabbitmq.com/

    node : rabbit at i
    app descriptor :
    /home/matthias/projects/rabbitmq-umbrella/rabbitmq-server/scripts/../ebin/rabbit.app
    home dir : /home/matthias
    config file(s) : (none)
    cookie hash : FtUD/+++wj4PBf6gRlNEsA==
    log : /tmp/rabbit at i.log
    sasl log : /tmp/rabbit at i-sasl.log
    database dir : /tmp/rabbitmq-rabbit-mnesia
    erlang version : 5.8.4


    Note the "config files" line above - in your case that should contain
    the filename of the config file.


    Matthias.
  • Raphael Simon at Oct 1, 2011 at 4:54 am
    Thank you, the log file being used is the right one, I was wondering though
    if there was a way to double check the 'sndbuf' and 'recbuf' values used to
    initialize the listeners (sanity check). We are still seeing 200KB /
    connection memory usage...

    --
    Raphael.

    On Thu, Sep 29, 2011 at 11:32 PM, Matthias Radestock
    wrote:
    Raphael,

    On 30/09/11 01:29, Raphael Simon wrote:

    Thank you Matthias. We deployed that config to production but haven't
    seen any real change... How can we tell if RabbitMQ is indeed using
    these settings?
    See http://www.rabbitmq.com/**configure.html#verify-**configuration<http://www.rabbitmq.com/configure.html#verify-configuration>

    When rabbit starts up it tells you what config file it is using, e.g.

    +---+ +---+
    +---+ +-------+
    RabbitMQ +---+ |
    v%%VSN%% +---+ |
    +-------------------+
    AMQP 0-9-1 / 0-9 / 0-8
    Copyright (C) 2007-2011 VMware, Inc.
    Licensed under the MPL. See http://www.rabbitmq.com/

    node : rabbit at i
    app descriptor : /home/matthias/projects/**rabbitmq-umbrella/rabbitmq-**
    server/scripts/../ebin/rabbit.**app
    home dir : /home/matthias
    config file(s) : (none)
    cookie hash : FtUD/+++wj4PBf6gRlNEsA==
    log : /tmp/rabbit at i.log
    sasl log : /tmp/rabbit at i-sasl.log
    database dir : /tmp/rabbitmq-rabbit-mnesia
    erlang version : 5.8.4


    Note the "config files" line above - in your case that should contain the
    filename of the config file.


    Matthias.
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110930/94a56796/attachment.htm>
  • Matthias Radestock at Oct 1, 2011 at 7:36 am
    Raphael,
    On 01/10/11 05:54, Raphael Simon wrote:
    Thank you, the log file being used is the right one, I was wondering
    though if there was a way to double check the 'sndbuf' and 'recbuf'
    values used to initialize the listeners (sanity check). We are still
    seeing 200KB / connection memory usage...
    You can also run 'rabbitmqctl environment'.

    You are connecting via AMQP, right, rather than, say, STOMP?

    It's possible that the O/S is configured with large buffer sizes. Check

    sysctl net.ipv4.tcp_rmem
    sysctl net.ipv4.tcp_wmem

    and perhaps adjust the settings.


    Regards,

    Matthias.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedSep 23, '11 at 6:11p
activeOct 1, '11 at 7:36a
posts6
users2
websiterabbitmq.com
irc#rabbitmq

People

Translate

site design / logo © 2022 Grokbase