Set prefetch/QoS across all Channels from the server side?

121 views
Skip to first unread message

Gavriel Fishel

unread,
Mar 15, 2020, 8:34:03 AM3/15/20
to rabbitmq-users
Hello Rabbitmq-users!

I have an issue with producers creating channels without QoS causing tons of "unacked messages" by slow consumers.
I can't control what the producers or consumers do as I'm the one responsible for the RabbitMQ server / policies.
 
The "unacked messages" pile up and cause lots of memory issues.

Is there a way I can enforce "Prefetch" or "QoS" across all Channels?
If it's controlled only from the service side, what other measures can I do to protect the server? ("max-length" and "ttl" work only on "ready messages").

Thanks,
Gavriel

Luke Bakken

unread,
Mar 16, 2020, 12:28:55 PM3/16/20
to rabbitmq-users
Hello,

There is no way to enforce QoS or a limit on un-acked messages from the server. You will have to ensure applications are written correctly.

Thanks,
Luke

Gavriel Fishel

unread,
Mar 16, 2020, 5:47:13 PM3/16/20
to rabbitmq-users
Thanks for the answer!

BR,
Gavriel

Johan Rhodin

unread,
Mar 17, 2020, 9:48:15 AM3/17/20
to rabbitmq-users
Hi,
Maybe not enforce but at least a default:
You can use: default_consumer_prefetch
{rabbit, [{default_consumer_prefetch, {true, 5}}]}

You can combine that with channel_max and the new in 3.7 vhost connection/queue limits.

/Johan
Message has been deleted
Message has been deleted

Gavriel Fishel

unread,
Mar 17, 2020, 4:53:33 PM3/17/20
to rabbitmq-users
Thanks for the info but im not sure it helped :(

I run on every node:
rabbitmqctl eval 'application:set_env(rabbit, default_consumer_prefetch, {true, 50}).'

And I still have over 20K unacked messages
also the "Global prefetch count" and "prefetch count" are still "0"

See attached screenshot
1.png

Luke Bakken

unread,
Mar 17, 2020, 5:21:39 PM3/17/20
to rabbitmq-users
Hello Gavriel,

You will have to make that setting in your configuration file and restart RabbitMQ.

Thanks,
Luke
Message has been deleted

Gavriel Fishel

unread,
Mar 19, 2020, 2:50:37 PM3/19/20
to rabbitmq-users
Thanks for the help!

Gavriel
Reply all
Reply to author
Forward
0 new messages