Skip to content

fix(clients): reduce chances of Push rate limiting #5153

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

Merged
merged 22 commits into from
Jul 23, 2025
Merged

Conversation

shortcuts
Copy link
Member

@shortcuts shortcuts commented Jul 22, 2025

🧭 What and Why

🎟 JIRA Ticket: https://algolia.atlassian.net/browse/DI-4062

Changes included:

the current implementation let no time for the rate limiting rules to breathe, since we are only waiting for the tasks after every batch have been sent to the api, but for some customer that send e.g. 1_000_000 records, they'd hit that 500 RPM limit quite quickly, before even finishing sending the records to process.

this pr updates the helper code of every clients in order to wait every batchSize/10 API calls, this smoothes the load a bit and potentially let the rule reset, we could even make that 10 configurable to give more control over potentially rate limited customers.

@shortcuts shortcuts self-assigned this Jul 22, 2025
@algolia-bot
Copy link
Collaborator

algolia-bot commented Jul 22, 2025

✔️ Code generated!

Name Link
🪓 Triggered by 1a3bd4aa3d6162e9cc8038e76361e5429cbb0274
🍃 Generated commit 3e2d1c05088b830e7850ca4cabe4af89db50f701
🌲 Generated branch generated/fix/push-rate-limit
📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
go 1759
javascript 1646
php 1480
csharp 1451
java 1111
python 1072
ruby 843
swift 666
scala 23

@shortcuts shortcuts force-pushed the fix/push-rate-limit branch from 90a325e to 1a5d52f Compare July 22, 2025 20:20
@shortcuts shortcuts force-pushed the fix/push-rate-limit branch from 18789dd to 07ff816 Compare July 22, 2025 20:49
@shortcuts shortcuts marked this pull request as ready for review July 22, 2025 21:26
@shortcuts shortcuts requested a review from a team as a code owner July 22, 2025 21:26
@shortcuts shortcuts requested review from morganleroi and Fluf22 July 22, 2025 21:26
@shortcuts shortcuts enabled auto-merge (squash) July 23, 2025 08:15
Copy link
Contributor

@morganleroi morganleroi left a comment

Choose a reason for hiding this comment

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

Huuuuge!

@shortcuts shortcuts merged commit 3160f87 into main Jul 23, 2025
30 checks passed
@shortcuts shortcuts deleted the fix/push-rate-limit branch July 23, 2025 08:16
algolia-bot added a commit that referenced this pull request Jul 23, 2025
algolia-bot added a commit to algolia/algoliasearch-client-go that referenced this pull request Jul 23, 2025
algolia-bot added a commit to algolia/algoliasearch-client-java that referenced this pull request Jul 23, 2025
algolia-bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request Jul 23, 2025
algolia-bot added a commit to algolia/algoliasearch-client-php that referenced this pull request Jul 23, 2025
algolia-bot added a commit to algolia/algoliasearch-client-python that referenced this pull request Jul 23, 2025
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.

3 participants