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

add sqs.send.mode config and allow async send #53

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

soumyajit-sahu
Copy link

Sync send calls are very limited in throughput. Utilizing async send calls boosts the throughput.
The config is optional with the default being "sync" mode.

@soumyajit-sahu
Copy link
Author

@dylanmei It would be great if you could review this. We weren't able to get a good enough throughput with the sync send, and the async mode helped sustain our production load.

@dylanmei
Copy link
Contributor

What limits were you reaching and what throughput are you achieving now?

@dylanmei
Copy link
Contributor

Please include information about the sync mode on the README.


for (Future<SendMessageResult> futureResult: futureResults) {
try {
SendMessageResult result = futureResult.get(30, TimeUnit.SECONDS);
Copy link
Contributor

Choose a reason for hiding this comment

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

Tell us more about this the error conditions here and this 30 second timeout.

Copy link
Author

@soumyajit-sahu soumyajit-sahu Jun 11, 2024

Choose a reason for hiding this comment

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

The 30 second timeout is to make sure that we yield control to the caller with a precise exception (timeout exception), rather than using a get() call without timeout and getting blocked on it without logging anything where it could be hard to debug issues with a "hung" connector.

I am not very sure about the best way to know if a send() op succeeded. The result.getMessageId() being valid is a guess that it would denote a successful operation.

@soumyajit-sahu
Copy link
Author

What limits were you reaching and what throughput are you achieving now?

We noticed that with a single topic-partition and a single Sink task, I noticed about 2-3 messages per second throughput. One way to get around this would have been to increase the topic's partition count and include more tasks for the connector. However, using the async mode got us a throughput of about 80 messages per second.

Note that the individual messages themselves were small (~250 bytes each) in our experiment.

While network latency would be a factor affecting the overall latency, I think the use of async mode would alleviate the throughput in any scenario without needing to scale horizontally.

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.

2 participants