Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kinesis enhanced fanout latency issue. #3118

Open
sohaib-rasool opened this issue Sep 20, 2024 · 3 comments
Open

Kinesis enhanced fanout latency issue. #3118

sohaib-rasool opened this issue Sep 20, 2024 · 3 comments
Labels
bug This issue is a bug. p3 This is a minor priority issue

Comments

@sohaib-rasool
Copy link

Describe the bug

When using aws-sdk-cpp to subscribe to a Kinesis stream with enhanced fanout via the SubscribeToShard() method, the SetEventStreamHandler() callback is invoked with noticeable delays, and data is received in batches instead of real-time. This causes inefficient processing of the stream data, leading to potential performance issues, especially in low-latency or real-time systems.stream data processing

Expected Behavior

  • The SetEventStreamHandler() should be invoked in near real-time as soon as new records are available in the Kinesis stream.
  • Records should be delivered individually or as soon as they are available without being unnecessarily batched or delayed.

Current Behavior

  • The SetEventStreamHandler() callback is delayed and not invoked immediately when new records arrive in the Kinesis shard.
  • Data is accumulated in batches and delivered with noticeable delays rather than being processed as soon as records are produced in the stream.

Reproduction Steps

  • Use aws-sdk-cpp to create a Kinesis enhanced fanout consumer.
  • Set up the SubscribeToShard() method with enhanced fanout and set the event handler using SetEventStreamHandler() to process incoming records.
  • Write a simple record producer that sends data to the Kinesis stream.
  • Observe that the SetEventStreamHandler() callback is invoked with delays and receives records in batches rather than as they become available

Possible Solution

No response

Additional Information/Context

  • The problem persists regardless of the producer's rate of sending records to the stream.
  • Slower the producer, higher the delays are (155 seconds delay if producer sends a single record)
  • Also mentioned in discussion Kinesis enhanced fanout latency issuethe

AWS CPP SDK version used

1.11.389

Compiler and Version used

gcc 11.4.0

Operating System and version

Ubuntu 22.04

@sohaib-rasool sohaib-rasool added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 20, 2024
@jmklix
Copy link
Member

jmklix commented Sep 24, 2024

Can you provide a minimal reproduction sample that follows the steps you listed above?

@jmklix jmklix added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Sep 24, 2024
@sohaib-rasool
Copy link
Author

sohaib-rasool commented Sep 24, 2024

kinesis_EFO_aws_issue.txt
image
image

I've attached the consumer code. This code does not throw any exception or set any error in subscribeOutcome. Its just that the handler is invoked with significant delay which is explained above.
Producer is pretty straightforward which works fine with other consumers.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. label Sep 25, 2024
@sohaib-rasool
Copy link
Author

@jmklix Any updates on this. And do let me know if you need anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

2 participants