s3-sqs-connector icon indicating copy to clipboard operation
s3-sqs-connector copied to clipboard

Fix max throughput issue

Open tavakara opened this issue 3 years ago • 3 comments

This pull request fixes the issue report in https://github.com/qubole/s3-sqs-connector/issues/9.

tavakara avatar Mar 28 '21 21:03 tavakara

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

crojasqnextroll avatar Apr 02 '21 16:04 crojasqnextroll

@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

abhishekd0907 avatar Apr 04 '21 13:04 abhishekd0907

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

sujeet-srivastava avatar Apr 06 '21 15:04 sujeet-srivastava