Publisher Flow Control for Message Queue Memory Management

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In message queues, publishers can overwhelm shared memory by enqueuing messages faster than consumers can consume them, leading to memory allocation issues and starving other publishers, while repeatable publishers face challenges in guaranteed delivery and recovery after failures.

Innovation Solution

Implementing Publisher Flow Control to restrict publishers based on specific conditions related to their usage, such as outstanding messages and recovery times, and using Bounded Guaranteed Delivery by spilling messages to permanent storage to manage memory and ensure delivery, with replay points for efficient recovery.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If publishers enqueue messages faster than consumers can consume them, then message throughput is improved, but memory allocation issues occur and other publishers are starved

Engineering Contradiction:
Improvemessage throughputVSAvoidmemory allocation stability
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system implements publisher flow control by monitoring the number of outstanding messages for each publisher and using this feedback to dynamically adjust their enqueue capability. When a publisher's outstanding message count exceeds a threshold, the system reduces or blocks their ability to enqueue new messages, preventing memory exhaustion while allowing high-throughput operation when memory is available.

Inventive Principle:
Principle #23Feedback

2Productivity

If publishers enqueue messages faster than consumers can consume them, then message throughput is improved, but other publishers are starved of resources

Engineering Contradiction:
Improvemessage throughputVSAvoidfair resource allocation
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The system applies local quality control by tracking and managing flow control parameters individually for each publisher. Each publisher receives customized flow control based on their specific outstanding message count and threshold, allowing differentiated rate limiting that ensures fair resource allocation while maintaining overall high throughput capability.

Inventive Principle:
Principle #3Local quality

3Reliability

If messages are spilled to permanent storage to manage memory, then memory overflow is prevented, but recovery time increases without replay points

Engineering Contradiction:
Improvememory overflow preventionVSAvoidrecovery time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system performs preliminary action by maintaining replay points that record the last successfully processed message position for each publisher before a failure occurs. When a failure is detected, the system uses these pre-established replay points to resume message processing from the correct position, eliminating the need to reprocess messages and significantly reducing recovery time.

Inventive Principle:
Principle #10Preliminary action

4Reliability

If repeatable publishers implement guaranteed delivery, then message delivery reliability is improved, but system complexity increases

Engineering Contradiction:
Improveguaranteed message deliveryVSAvoidflow control mechanism complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system applies segmentation by dividing the flow control and guaranteed delivery mechanism into separate, manageable components: per-publisher outstanding message tracking, per-publisher flow control decisions, and per-publisher replay point management. This modular approach achieves guaranteed delivery for repeatable publishers while keeping the overall system complexity manageable through clear separation of concerns.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS8397244B2Publisher flow control and bounded guaranteed delivery for message queues
Publication Date: 2013.03.12 ORACLE INT CORP
  • US8397244B2 patent drawing
  • US8397244B2 patent drawing
  • US8397244B2 patent drawing

AI summary

Techniques for managing messages in computer systems are provided. In one embodiment, in response to a publisher attempting to enqueue a message in a queue, a determination is made whether a condition is satisfied. The condition is based on the current usage of the queue by the publisher. Based on whether the condition is satisfied, a decision is made whether to enqueue the message in the queue. The decision whether to enqueue the message may comprise restricting the publisher from enqueueing any more messages in the queue until the same or a different condition is satisfied.