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

Significant delays when sending messages to large groups #67

Open
uazapi opened this issue Dec 20, 2024 · 0 comments
Open

Significant delays when sending messages to large groups #67

uazapi opened this issue Dec 20, 2024 · 0 comments

Comments

@uazapi
Copy link

uazapi commented Dec 20, 2024

Description
We're experiencing significant delays when sending messages to large groups. Our tests show that a single message can take between 54-116 seconds to be sent to one group, which often results in timeout issues in production environments.

Test Results
We conducted three sequential tests sending a simple text message to the same group:

Test 1:

  • Duration: 116.544 seconds

Test 2:

  • Duration: 56.925 seconds

Test 3:

  • Duration: 54.496 seconds

Impact

  1. These delays are causing timeout issues in production applications
  2. The message queue gets blocked since it's sequential, preventing other messages from being sent
  3. Poor user experience due to long waiting times

Expected Behavior
Message sending to groups should complete in a reasonable time frame (few seconds), similar to how it works in the official WhatsApp clients.

Relevant Code
We're using the standard SendMessage function:

_, err := client.SendMessage(context.Background(), recipient, msg)

Questions

Is this expected behavior for large groups?
Are there any recommended workarounds or best practices for handling large group messages?
Could this be optimized in the library level?

Additional Context

Using latest version of whatsmeow
These delays occur consistently with large groups
The delays seem to be related to the encryption process for multiple recipients, as the time increases with group size

The performance difference compared to Baileys suggests this might be optimizable

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

No branches or pull requests

1 participant