banner



rabbitmq tcp_listen_options binary

Priit Karu

unread,

May 6, 2015, 9:07:twoscore PM 5/6/xv

to rabbitm...@googlegroups.com

Hello, fellow RabbitMQ users!

I am very new RabbitMQ user (using version iii.5.1) and struggeling to understand the retentiveness usage with my simple application. I am using Stomp plugin and take 100 clients continued (creating around 500 queues). There is not much activity at that place from the clients, the arrangement is mainly idle. What i practice not understand is the high retention usage of my Rabbit instance. Namely why and then much memory is gone to binaries section and why the "Binary references" department does not evidence the use of that retentivity. Cheers for whatever clues that would help me to minimize Rabbit memory employ in this case.

Movie from Rabbit Web Console:

Output of "rabbitmqctrl status":

Status of node 'rabbit@pk-pc' ...

[{pid,2194},

 {running_applications,

     [{rabbitmq_management,"RabbitMQ Management Console","3.v.1"},

      {rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.5.ane"},

      {webmachine,"webmachine","1.ten.3-rmq3.5.1-gite9359c7"},

      {mochiweb,"MochiMedia Web Server","2.7.0-rmq3.5.one-git680dba8"},

      {rabbitmq_stomp,"Embedded Rabbit Stomp Adapter","3.5.1"},

      {rabbitmq_management_agent,"RabbitMQ Management Agent","three.v.1"},

      {rabbit,"RabbitMQ","3.v.1"},

      {os_mon,"CPO  CXC 138 46","two.2.14"},

      {mnesia,"MNESIA  CXC 138 12","4.eleven"},

      {amqp_client,"RabbitMQ AMQP Client","3.5.1"},

      {sockjs,"SockJS","0.3.iv-rmq3.5.1-git3132eb9"},

      {inets,"INETS  CXC 138 49","v.9.7"},

      {xmerl,"XML parser","one.three.5"},

      {sasl,"SASL  CXC 138 11","2.3.4"},

      {stdlib,"ERTS  CXC 138 10","ane.19.iv"},

      {kernel,"ERTS  CXC 138 10","2.16.iv"}]},

 {bone,{unix,linux}},

 {erlang_version,

     "Erlang R16B03 (erts-5.x.4) [source] [64-flake] [smp:four:iv] [async-threads:30] [kernel-poll:true]\n"},

 {retentiveness,

     [{total,372755696},

      {connection_readers,0},

      {connection_writers,0},

      {connection_channels,0},

      {connection_other,22698048},

      {queue_procs,23044248},

      {queue_slave_procs,0},

      {plugins,11556504},

      {other_proc,11947144},

      {mnesia,1911816},

      {mgmt_db,6136048},

      {msg_index,2087400},

      {other_ets,1717856},

      {binary,265533264},

      {lawmaking,20184143},

      {atom,703377},

      {other_system,5235848}]},

 {alarms,[]},

 {listeners,[{clustering,25672,"::"},{amqp,5672,"::"},{stomp,61613,"::"}]},

 {vm_memory_high_watermark,0.4},

 {vm_memory_limit,6681539379},

 {disk_free_limit,50000000},

 {disk_free,97045086208},

 {file_descriptors,

     [{total_limit,924},

      {total_used,105},

      {sockets_limit,829},

      {sockets_used,103}]},

 {processes,[{limit,131072},{used,2840}]},

 {run_queue,0},

 {uptime,4122}]

Cheers for any clues.

BR,

Priit.

Michael Klishin

unread,

May half-dozen, 2015, 9:13:12 PM 5/6/xv

to Priit Karu, rabbitm...@googlegroups.com

Almost of that memory is TCP buffers. You can configure their size to eight-16K to get significant decrease in RAM use for low activity connections.

MK

Priit Karu

unread,

May 6, 2015, ix:22:23 PM v/half-dozen/xv

to rabbitm...@googlegroups.com, pka...@gmail.com

Thanks, Michael for quick response.

I accept already changed the tcp_listen_options for my rabbit instance but have non got any alter to the binary size. My ubuntu had default buffer for both tcp_rmem and tcp_wmem gear up to87380:

cat /proc/sys/cyberspace/ipv4/tcp_rmem
 4096 87380 6291456

Hither is my rabbitmq.conf.

[{rabbit,

 [

        {tcp_listen_options, [binary,

                                  {sndbuf,        4096},

                                  {recbuf,        4096},

                                  {buffer,        4096},

                                  {parcel,        raw},

                                  {reuseaddr,     true},

                                  {backlog,       128},

                                  {nodelay,       true},

                                  {linger,        {true, 0}},

                                  {exit_on_close, false}]}]}

].

Am i doing something still wrong with this configuration as it does not seem to change the "binary" memory size at all.

Michael Klishin

unread,

May 6, 2015, 9:33:42 PM 5/6/xv

to Priit Karu, rabbitm...@googlegroups.com

Exercise you observe a growing number of connections? There was a issues fix in STOMP after 3.5.1 which makes sure we don't leave connections with terminated due to socket exceptions behind.

Your understanding of TCP options seems to be correct and indeed autotuning defaults to about 87K on Linux.

MK

Priit Karu

unread,

May seven, 2015, 1:29:thirteen PM 5/vii/15

to rabbitm...@googlegroups.com, pka...@gmail.com

At that place are no growing connections, both RabbitMQ admin and netstat show steady number of connections.

Is there whatever way for me to cheque if the tcp_listen_options are actually practical? I have already checked that the configuration file is right and other properties practice get applied, i have also tried to change the underlying OS defaults of rmem to "4096     4096 6291456" (wmem accordingly) but the binaries memory usage stays the same:-(  The awarding is almost totally at idle afterwards some initial information commutation between the queues, maybe 1 bulletin get posted to topic in one infinitesimal, all the queues are empty.

Would appreciate whatsoever other ideas what to exam or bank check...

Thanks,

Priit.

Michael Klishin

unread,

May 7, 2015, 4:32:08 PM 5/7/xv

to rabbitm...@googlegroups.com, Priit Karu

On 7 May 2015 at 09:29:fifteen, Priit Karu (pka...@gmail.com) wrote:
> There are no growing connections, both RabbitMQ admin and netstat
> show steady number of connections.

rabbitmqctl eval 'awarding:get_env(rabbitmq_stomp, tcp_listen_options).'

You've configured TCP heed options for RabbitMQ "core", AMQP 0-9-1 and 1.0 connections.

STOMP has its own option (with the same name, only app name differs), equally the docs
demonstrate ;)
http://www.rabbitmq.com/stomp.html
--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Priit Karu

unread,

May 7, 2015, vi:42:23 PM 5/vii/15

to rabbitm...@googlegroups.com, pka...@gmail.com

:-)

Thank you! I knew it had to be something simple! Now the binaries office is gone and the retentiveness diagram looks more understandable to me.

Only i am still struggling a bit with my real application and RabbitMQ memory usage. The real awarding creates a lot of queues with unlike names per connection which are used quite rarely. I wonder if there is anything i can do to on the Rabbit side to reduce the queue processes memory footprint for those queues that exercise non have whatever heavy traffic (possible swapping them even abroad from RAM when idl) or is the only solution to change awarding code and reduce the number of queues used?

Currently i run into one queue takes more than 20kb even when total empty and without whatever activity:

BR,

Michael Klishin

unread,

May 7, 2015, 7:xi:02 PM 5/7/15

to rabbitm...@googlegroups.com, Priit Karu

On 7 May 2015 at xiv:42:25, Priit Karu (pka...@gmail.com) wrote:
> I wonder if there is anything i tin practice to on the Rabbit side to reduce
> the queue processes memory footprint for those queues that do
> non have any heavy traffic (possible swapping them even away
> from RAM when idl) or is the but solution to change application
> code and reduce the number of queues used?

You lot can increment statistics collection interval, that'southward most it.

饶林

unread,

Jun 21, 2017, 7:14:32 PM six/21/17

to rabbitmq-users, pka...@gmail.com

I accept same consequence with you lot,  You lot said it'south fine now, just add together

 [{rabbit,

 [

        {tcp_listen_options, [binary,

                                  {sndbuf,        4096},

                                  {recbuf,        4096},

                                  {buffer,        4096},

                                  {packet,        raw},

                                  {reuseaddr,     true},

                                  {backlog,       128},

                                  {nodelay,       truthful},

                                  {linger,        {true, 0}},

                                  {exit_on_close, faux}]}]}

].

into rabbitmq.config? Tin can y'all explain that specifically?

Michael Klishin

unread,

Jun 21, 2017, eight:56:45 PM vi/21/17

to rabbitm...@googlegroups.com

Please use new threads for new questions.

You can reduce TCP connection buffer sizes if you have prove of a lot of

If there is no such bear witness, instead of guessing and applying suggestions from threads

that seem "similar", collect retentiveness usage breakdown with `rabbitmqctl status` and rabbitmq-tiptop.

Direction UI has a button that provides the same breakdown on the node page.

饶林

unread,

Jun 22, 2017, 8:48:36 AM vi/22/17

to rabbitmq-users

Thank you, Michael  for quick response. My connectedness is  5 -10, and consumers is about 100, so I confuse with the
Binaries is more than higher than Binaries references(not any letters in rabbitMQ). Only I kill the process ,the memory is normal now. And last nighttime ,I increment the buffer  size,It's normal now in morning. So if there are any questions I will create a new threads for the question. I will share the details in question. Thank you so much.

饶林

unread,

Jun 23, 2017, 8:31:05 PM half dozen/23/17

to rabbitmq-users

On Wednesday, June 21, 2017 at nine:56:45 PM UTC+8, Michael Klishin wrote:

Source: https://groups.google.com/g/rabbitmq-users/c/yHasBTGGnqk

Posted by: jamesevisiou.blogspot.com

0 Response to "rabbitmq tcp_listen_options binary"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel