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

Fix max throughput issue #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tavakara
Copy link

This pull request fixes the issue report in #9.

@crojasqnextroll
Copy link

Hi @tavakara this PR makes sense to me, were you able to get a better throughput rate with this change?

@abhishekd0907
Copy link
Collaborator

@tavakara
SQSClient doesn't fetch one message per request but a list of messages. However, due to the current code, there is a minimum delay of one second between two requests. I am happy to accept a change that will make this delay configurable in milliseconds as compared to seconds.

However, I would like to point out that the advisable way of polling SQS is to minimize the frequency of polling and fetch the maximum possible messages per request in order to save costs. Also, keep in mind that polling SQS too frequently by your client may lead to throttling and give 429 errors as discussed here Stackoverflow

@@ -82,7 +82,7 @@ class SqsClient(sourceOptions: SqsSourceOptions,
sqsFetchMessagesThread,
0,
sqsFetchIntervalSeconds,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change the variable names in code / tests and documentation accordingly to milliseconds to avoid confusion

@sujeet-srivastava
Copy link

sujeet-srivastava commented Apr 6, 2021

I changed the sqsFetchInterval to accept milliseconds: see here - https://github.com/sujeet-srivastava/s3-sqs-connector

Tested as below:

  • Added 4890 (total size =10Gb) files to a bucket linked up to a Queue
  • Created a streaming sql query from this Queue to dump the content into another location after minor processing
  • I could achieve a message receive rate at 3.6k messages/sec in SQS with fetchInterval set to 10 millisec
  • did not see throttling
  • no data loss.
  • The limit to seconds seems unnecessary

This fix is needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants