Utilize QoS to prevent excessive client side queueing of messages

Bug #1531222 reported by John Eckersberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.messaging
Fix Released
Undecided
John Eckersberg

Bug Description

AMQP supports setting quality of service:

https://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.qos

This limits the number (or size) of unacknowledged messages sent to a client.

By default, not setting qos implies that the messages sent are unlimited, meaning that the messages will be sent to the client(s) as quickly as possible. This can cause a large number of messages to queue up on the client(s), which is undesirable because those messages cannot be processed by another server.

Suppose you have a topic with one consumer, and you send hundreds or thousands of messages to the topic. The broker will send the messages to the consumer as fast as the transport will allow. Now suppose the messages take a long time to process on the consumer... maybe each one takes 30 seconds. Queueing up 100 messages means that the consumer has committed to 3000 seconds of work. It would be nice to recognize that such a backlog of work is present, and to bring up additional consumers on the topic to process the work. But because the messages are already consumed by the original consumer, the new consumers cannot help with the original load of messages.

For more details, check out https://www.rabbitmq.com/blog/2012/05/11/some-queuing-theory-throughput-latency-and-bandwidth/

I propose a two step approach to fixing this in oslo.messaging:

(1) Add configuration options to manually define qos count/size, and simply call the basic.qos method when new channels are created.

(2) Implement a "controlled delay" algorithm in the client in order to adjust the buffer size dynamically, similar to the java client (https://gist.github.com/msackman/2658712) as described in the above article. This belongs lower in the stack (py-amqp/kombu/etc) but would ultimately need to be enabled/utilized within oslo.messaging.

Changed in oslo.messaging:
assignee: nobody → John Eckersberg (jeckersb)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.messaging (master)

Fix proposed to branch: master
Review: https://review.openstack.org/264911

Changed in oslo.messaging:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.messaging (master)

Reviewed: https://review.openstack.org/264911
Committed: https://git.openstack.org/cgit/openstack/oslo.messaging/commit/?id=bb8f950edcddfba843ebf7685e927f9e43363d67
Submitter: Jenkins
Branch: master

commit bb8f950edcddfba843ebf7685e927f9e43363d67
Author: John Eckersberg <email address hidden>
Date: Tue Jan 19 22:59:38 2016 -0500

    rabbit: Add option to configure QoS prefetch count

    Change-Id: I585cd4636e62cdd0c9f1595a6c029cb56f845be9
    Closes-Bug: #1531222

Changed in oslo.messaging:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.messaging (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/273225

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.messaging (stable/liberty)

Reviewed: https://review.openstack.org/273225
Committed: https://git.openstack.org/cgit/openstack/oslo.messaging/commit/?id=b1921426c8fc97da651d1bb3a267b4943e9609f4
Submitter: Jenkins
Branch: stable/liberty

commit b1921426c8fc97da651d1bb3a267b4943e9609f4
Author: John Eckersberg <email address hidden>
Date: Wed Jan 27 15:17:39 2016 -0500

    rabbit: Add option to configure QoS prefetch count

    Change-Id: I585cd4636e62cdd0c9f1595a6c029cb56f845be9
    Closes-Bug: #1531222
    (cherry picked from commit bb8f950edcddfba843ebf7685e927f9e43363d67)

tags: added: in-stable-liberty
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.messaging (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/273711

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/oslo.messaging 4.1.0

This issue was fixed in the openstack/oslo.messaging 4.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on oslo.messaging (stable/kilo)

Change abandoned by John Eckersberg (<email address hidden>) on branch: stable/kilo
Review: https://review.openstack.org/273711

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.